-
Notifications
You must be signed in to change notification settings - Fork 126
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
Hydration not fully compatible with React 18 #250
Comments
Sounds good. Re: server, as long as client expects exactly the same output, no |
I made the changes to the ClojureScript ns to get it working (using this as reference: https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis). Not too bad all-in-all, just need to store the root and reuse it instead of the DOM node. However, I'm at a loss at how to resolve the new react package. Personally, I use shadow-cljs in my projects, but Rum seems wedded to cljsjs (which is fine). I don't know how to dynamically refer to "react-dom/client" which is where these new imports are located. [cljsjs.react]
[cljsjs.react.dom] |
Turns out I had to do ["react-dom/client" :as rdc] and then use that directly rather than However, this might work with shadow-cljs, but I guess it would break with users of cljsjs? I'm not smart enough to know. Proof-of-concept available at: https://github.com/kuhumcst/rum/tree/fix/250-react-18 |
Hi, just exploring rum and wondering what the latest story is with react 18. @simongray - perhaps you could submit your proof of concept as a PR so rum can officially get up to react 18? |
Attempting to hydrate while using React 18 results in the following warning:
I guess the fix is simple enough in the frontend, e.g. detect whether React 17 or 18 is loaded and call the appropriate function, but should anything be done server-side as well?
The text was updated successfully, but these errors were encountered: