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
Warning: ReactDOM.hydrate is no longer supported in React 18 #2564
Comments
Remix 1.3.3 was released prior to React 18 :) The only part using |
Re-opening because it would be good to keep track of this as long as we don't support React v18 |
I tried updating
I get this error in the console:
The suggestion in React docs is to change hydrate as follows:
This is slightly different compared to my remix code where I am passing the entire document to |
I'm going to close this again so we can consolidate problems with React 18 to a single issue, as this is very much a WIP already. Let's keep discussion of those issues in #577 |
How about this? // entry.client.tsx
import { RemixBrowser } from "@remix-run/react";
import { hydrateRoot } from "react-dom/client";
hydrateRoot(document, <RemixBrowser />); // package.json
{
"private": true,
"sideEffects": false,
"scripts": {
"build": "remix build",
"dev": "remix dev",
"start": "remix-serve build"
},
"dependencies": {
"@remix-run/node": "^1.5.1",
"@remix-run/react": "^1.5.1",
"@remix-run/serve": "^1.5.1",
"react": "^18.1.0",
"react-dom": "^18.1.0"
},
"devDependencies": {
"@remix-run/dev": "^1.5.1",
"@remix-run/eslint-config": "^1.5.1",
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
"eslint": "^8.15.0",
"typescript": "^4.6.4"
},
"engines": {
"node": ">=14"
}
} |
What version of Remix are you using?
1.3.3
Steps to Reproduce
basic app
yarn run dev
Expected Behavior
Remix uses hydrateRoot and behaves as if it's running React 18.
Actual Behavior
Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot
The text was updated successfully, but these errors were encountered: