route.useSomething() and eslint(react-hooks/rules-of-hooks)
is it ok to do this:
instead of this?
(same question for other route.useSomething hooks). the latter option is what i'm seeing in the docs, but you'll miss out on rule-of-hooks eslint warnings if you do it that way. looking at the source code, the former option should have the same behaviour right now, but I want to avoid any unexpected breaking changes if the API isn't supposed to be used this way 😅
1 Reply
foreign-sapphire•2y ago
It might be okay
Try out
If you get this is undefined, then it’s not okay.
If that’s the case, I’ll provide a non class implementation