What does ReactDOM.createRoot do?
Model answer
createRoot connects React to a real DOM element on the page. You pass it the root element, for example document.getElementById('root'), and call render with your top-level component: createRoot(el).render(<App />).
It is the entry point of a client-side React app. It replaced the older ReactDOM.render and enables modern React features such as concurrent rendering.
Learn this topic
What Is React? Why Use It and How It Works in the course React.js Full Course: Beginner to Advanced.
Sign in to add your own answer.