Cannot use `useState` inside of callback?
I'm getting this error even though im using it inside a function that returns JSX.Element... No errors in my dev environment, only the vercel linter is saying it fails to compile
4 Replies
in general hooks need to be called at the top level of a function and cant be called conditionally (other than the brand new
use()
hook which theyre still working onShow code??
so you cant call useState() inside a callback
ah yep must be because of the conditionals
I guess if I break them out into components it should work