Put in order · JavaScript and React course · Module 1: React Basics

Rendering a React application

Arrange the syntax for rendering the App component to the DOM in main.jsx (React 18+):

Items to put in order

  • ReactDOM.createRoot(
  • ).render(
  • document.getElementById('root')
  • <App />
  • )
Show the answer

Correct order:

  1. ReactDOM.createRoot(
  2. document.getElementById('root')
  3. ).render(
  4. <App />
  5. )