Skip to content

BREAKING: Update to react-dom 18 client changes #1186

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

Closed
wants to merge 1 commit into from

Conversation

ynagorny
Copy link

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".

@justin808
Copy link
Collaborator

@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 justin808 marked this pull request as draft August 10, 2022 05:11
@justin808 justin808 changed the title Update to react-dom 18 client changes BREAKING: Update to react-dom 18 client changes Aug 10, 2022
@maedi
Copy link

maedi commented Aug 15, 2022

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?

@justin808
Copy link
Collaborator

Closed in favor of #1194.

@justin808 justin808 closed this Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants