-
Notifications
You must be signed in to change notification settings - Fork 9
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
Invalid hook call
issue related to duplicate react versions
#96
Comments
First of all, thank you for reporting this issue. As far as I know, the current module specifies Thank you! |
I had this exact problem with other modules that depend on |
Are you in a situation where Module A uses |
Yes exactly. In fact I already have these peerDependencies set in Module A, but it didn't help: "peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
} Module B has: "dependencies": {
"react": "18.3.1",
"react-dom": "18.3.1",
} I see this module has |
I encounted a issue with React
Invalid hook call
error when using this module inside a library module which is linked into another project vianpm link
and I think the way this module interacts withreact-dom
is the root cause which leads to two instances of react to be loaded in such scenarios. Also see this related StackOverflow answer.I will try to provide a minimal reproduction, but ultimately i think this module needs to provide a
<Toaster>
-like component that the user can insert into the component tree somewhere to remove thereact-dom
dependency, maybe optionally.The text was updated successfully, but these errors were encountered: