-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hooks can only be called inside the body of a function component #35
Comments
Thanks, I'll try to cold it. I'm closing this issue as answered, if the issue persists, I'll reopen it. |
I am not using RHL, however, I am getting this error. I try to use other hooks but they work. It is a simple enough project. Here is the repo Edit: This was the problem. facebook/react#13991 |
I solved this by removing the caret for React dependency in my "react": "16.7.0-alpha.2",
"react-dom": "16.7.0-alpha.2", See this comment for more info: facebook/react#14454 (comment) @aalpgiray, you have |
Thanks @doasync |
My code is like:
As you can see,
View
is a function component, however it still produces an error:If I comment out
1st useAction
and use2nd useAction
, a customized useAction, it will work.I'm not sure if this is a React bug or an
easy-peasy
bug, the definition https://github.com/ctrlplusb/easy-peasy/blob/master/src/hooks.js#L48 is indeed a simple function, just like mine.The text was updated successfully, but these errors were encountered: