Invalid hook call. Hooks can only be called inside of the body of a function component. #6047
Unanswered
codingwithashu
asked this question in
General
Replies: 1 comment 1 reply
-
you're calling
to have hooks work properly, you have to "call" them with jsx:
see: https://kentcdodds.com/blog/dont-call-a-react-function-component |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Shadcn UI,
I have created Dialog as a component and passed the form as children (props) so whenever button submit getting error like
"Invalid hook call. Hooks can only be called inside of the body of a function component."
This is Dialogbox
this form with button with useQuery --

This component
Beta Was this translation helpful? Give feedback.
All reactions