Skip to content
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

Update the React recipe for React v18 #1049

Open
rapaccinim opened this issue Sep 13, 2022 · 0 comments
Open

Update the React recipe for React v18 #1049

rapaccinim opened this issue Sep 13, 2022 · 0 comments

Comments

@rapaccinim
Copy link

The React recipe is not showing a correct example of src/index.js for React v18.

ReactDOM.render is no more used in React v18, instead it's necessary to use ReactDOM.createRoot.

This is a practical working example that can be used:

import ReactDOM from "react-dom/client";
import { App } from "./App";

const root = ReactDOM.createRoot(document.getElementById("app"));
root.render(<App />);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant