react-rails
react-rails copied to clipboard
BREAKING: Update to react-dom 18 client changes
Update to import react-dom/client package instead of react-dom as described in:
https://reactjs.org/docs/react-dom.html
This takes care of this react 18 warning:
You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".
@ynagorny
This seems to be a breaking change for those that don't upgrade to React 18.
Please confirm.
Do you want to propose a solution that works with React 16+17 and React 18?
Functions like ReactDOM.hydrate
are still in the core library, only createRoot
and hydrateRoot
are in react-dom/client
(see: https://github.com/facebook/react/blob/main/packages/react-dom/client.js).
I've created a PR (#1194) which uses the correct core/client APIs and attempts to provide backwards compatibility for React 16/17. Can someone test?
Closed in favor of #1194.