Hi ! Thank you a lot for this article and video, it helps me a lot !
I may have found something useful if you want to use external librairies (like material UI, HighchartJS, etc) and do some custom components in your npm package (storybook).
The error
Unhandled Runtime Error Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
You might have mismatching versions of React and the renderer (such as React DOM)
You might be breaking the Rules of Hooks
You might have more than one copy of React in the same app
The why
The React of the parent project is being used, instead of using the second, that is a duplicate React.
The solution
I found a solution (here and here) where you just have to add this line inside the rollup.config.js file :
Hi ! Thank you a lot for this article and video, it helps me a lot !
I may have found something useful if you want to use external librairies (like material UI, HighchartJS, etc) and do some custom components in your npm package (storybook).
The error
The why
The React of the parent project is being used, instead of using the second, that is a duplicate React.
The solution
I found a solution (here and here) where you just have to add this line inside the rollup.config.js file :
That's really helpful. Thanks!
My fix was simply moving
reactandreact-domtopeerDependenciesinpackage.jsonGood stuff, thanks for the resource!
That's really helpful. Thanks!
Thank you so much for sharing the solution!!!