-
Notifications
You must be signed in to change notification settings - Fork 48.4k
React Hooks not working + single instance of React #15338
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
Comments
I have the same problem |
React doesn't support You'll have to get Parcel to flatten the React modules from both workspaces into a single module (i.e. like Webpack alias). Or, maybe Yarn |
same issue here. Yarn resolutions does not affect anything at all. And my app is created with create-react-app so I'm not able to change any webpack for adding aliases. Any ideas? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
facing same issue |
I originally posted this in the hooks thread, but this appears to be a separate issue as none of the troubleshooting steps resolve it, and I appear to only have a single copy of React... help would be greatly appreciated - I have a simple reproduction linked below.
Issue:
I'm having an issue using a very basic reproduction using yarn workspaces example - https://github.com/mwarger/yarn-workspace-hooks-repro
I have a
component-library
that is written in typescript and bundled with parcel. Theexample-demo
is what will showcase thiscomponent-library
and is a freshly created CRA app. All common packages are hoisted with yarn, so in theory there should only be one version of react available. However, theReact.useEffect
call I'm making in index.tsx causes the error that leads me to this GitHub issue.Everything works until a hook is added. To reproduce the error, uncomment lines 7-9 in
component-library/src/index.tsx
Hopefully I'm doing something silly that I have overlooked. Please advise as to any steps I may use to try and remedy this. Thank you!
Follow-up Edit: The below suggested debug script output prints
true
for me. It appears that I do not have two Reacts.Originally posted by @mwarger in #13991 (comment)
The text was updated successfully, but these errors were encountered: