Importing and using motion component giving error: 'Invalid hook call. Hooks can only be called inside of the body of a function component.' #1638
Unanswered
prakhar-nigam70
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there, needed help with this issue I am facing when trying to use motion.
There are two applications, a cra(create-react-app) and Gatsby application, and they are inside the root folder. I did install framer motion in the root folder. Now trying to use the motion component inside cra application giving the error: "Invalid hook call. Hooks can only be called inside of the body of a function component." This comes irrespective of a class based or functional component.
Here is the StackOverflow link: https://stackoverflow.com/questions/73173602/using-framer-motion-inside-the-application-giving-error-invalid-hook-call-ho
Please let me know if the question is missing anything.
Beta Was this translation helpful? Give feedback.
All reactions