Warning: Invalid hook call. Hooks can only be called in of the body of a function component.…

I got this warning when I use any of these ( Autocomplete, Formik, YUP, React-Hook-Form, Rect-Select ). Please help, THANKS🙏
No description
No description
4 Replies
Zoë
Zoë14mo ago
Could we see where you used hooks since the last time that there weren't errors
ChengXiao
ChengXiao14mo ago
This is not my code but my old code is look like this
No description
ChengXiao
ChengXiao14mo ago
My new code and I always use hook inside function
No description
Jochem
Jochem14mo ago
just as a pro tip, it's much more useful to share your code by copy-pasting it to a codeblock in discord, or even better to reproduce the problem on something like jsfiddle or stackblitz and share that. Take a look at the #how-to-ask-good-questions channel and #How To Ask Good Questions post in this forum. screenshots are hard to read and no one is going to bother retyping your code if they want to try to run it themselves
Want results from more Discord servers?
Add your server