react-rails icon indicating copy to clipboard operation
react-rails copied to clipboard

BREAKING: Update to react-dom 18 client changes

Open ynagorny opened this issue 2 years ago • 1 comments

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 avatar Jun 29 '22 15:06 ynagorny

@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?

justin808 avatar Aug 10 '22 05:08 justin808

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?

maedi avatar Aug 15 '22 08:08 maedi

Closed in favor of #1194.

justin808 avatar Aug 15 '22 22:08 justin808