React · Junior · Question 39 of 75

How do you attach an app to a DOM element in React 18+?

Explanation

createRoot from react-dom/client enables React 18+ concurrent features. ReactDOM.render is deprecated and removed in React 19. To hydrate server-rendered HTML, use hydrateRoot. Frameworks like Next.js do this automatically.

Further reading

Problem with a question

React · Junior · question 39

Test yourself

Take the React · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz