Description
Do you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
Using a custom hook from a locally linked package lead to the unexpected error "Hooks can only be called inside the body of a function component."
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
Here is the github repository to reproduce this error
Steps:
- In the root folder run
yarn
- In the
hook
folder runyarn link
- In the root run
yarn link hook
, thenyarn start
You will see the error.
What is the expected behavior?
Code should work and do not throw an error.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React: 16.7.0-alpha.2
Browser: Chrome 70.0.3538.102
OS: Windows 7/10, Ubuntu 18.10