Open rapaccinim opened 2 years ago
The React recipe is not showing a correct example of src/index.js for React v18.
src/index.js
ReactDOM.render is no more used in React v18, instead it's necessary to use ReactDOM.createRoot.
ReactDOM.render
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 />);
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 useReactDOM.createRoot
.This is a practical working example that can be used: