Skip to content
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

React has detected a change in the order of hooks #452

Closed
sahajjain1 opened this issue Nov 28, 2023 · 5 comments
Closed

React has detected a change in the order of hooks #452

sahajjain1 opened this issue Nov 28, 2023 · 5 comments

Comments

@sahajjain1
Copy link

sahajjain1 commented Nov 28, 2023

getting error : React has detected a change in the order of hooks... while using @preact/[email protected] and cant update the signal version above 1.1.1 as it will not work with my React version 17.0.2
any suggestions?

image

similar to #414

@XantreDev
Copy link
Contributor

XantreDev commented Nov 28, 2023

Do you using signals with Vite? Webpack?
Which version of @preact/signals-react is not working with 17.0.2? I know that 1.2.1 should work with this react version

@sahajjain1
Copy link
Author

Using Webpack
i tired with 1.2.1 and 1.1.1 getting the same above issue React has detected a change in the order of hooks. but when i tried your (https://github.com/XantreGodlike/preact-signals/tree/main/packages/react) it was working perfectly.
we have decided to upgrade the react to latest versrion and now we can use the latest version of @preact/signals-react hopefully the issue wont show up again

@edgars-sirokovs
Copy link

I encountered this warning with Remix (v2.3.1) + Vite (v5.0.4), @preact/signals-react v1.3.7

Warning: React has detected a change in the order of Hooks called by RemixBrowser.

@XantreDev
Copy link
Contributor

I encountered this warning with Remix (v2.3.1) + Vite (v5.0.4), @preact/signals-react v1.3.7

Warning: React has detected a change in the order of Hooks called by RemixBrowser.

I'm not sure that for now there is a bullet proof way to use automatic deps tracking in remix.
I will release the manual method of integration with HOCs - it will be bullet proof and work in all envitements

@XantreDev
Copy link
Contributor

I've done it. Check it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants