-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
NPM link local react hooks library reporting errors: Hooks can only be called inside the body of a function component. #8607
Comments
Is there only a single |
@sokra All versions are 16.7.0-alpha.2 |
Yes, but this was not the question. react breaks when you include it twice (even if the version is equal). Make sure to only include a single react in the bundle. Try |
@sokra Thank you, this can solve this problem! |
Bug report
This is a react hooks library rc-form-hooks, which was linked in the example and will now report an error.
It looks like a compiled problem because I yarn installed it without errors
What is the current behavior?
Hooks can only be called inside the body of a function component.
It should look like this:
If the current behavior is a bug, please provide the steps to reproduce.
git clone https://github.com/mushan0x0/rc-form-hooks
cd rc-form-hooks
yarn && yarn start
cd example
yarn && yarn start
What is the expected behavior?
no error
Other relevant information:
webpack version: 4.19.1
Node.js version: 10.6.0
Operating System: mac os
Additional tools: react-scripts 2.1.3
The text was updated successfully, but these errors were encountered: