Complete the code to render a React component into the root element.
ReactDOM.[1](<App />, document.getElementById('root'));
The render method of ReactDOM is used to display a React component inside a DOM element.
Complete the code to create a root for React 18+ rendering.
const root = ReactDOM.[1](document.getElementById('root'));
In React 18+, createRoot is used to create a root for concurrent rendering.
Fix the error in the code to render the component using the root.
root.[1](<App />);After creating a root with createRoot, you call render on it to display the component.
Fill both blanks to hydrate a server-rendered React app.
ReactDOM.[1]Root(document.getElementById('root')).[2](<App />);
To hydrate a server-rendered app in React 18+, you use hydrateRoot to create the root and then render to display the component.
Fill all three blanks to create a root and render a component with strict mode.
const root = ReactDOM.[1](document.getElementById('root')); root.[2]( <React.[3]> <App /> </React.[3]> );
This code creates a root with createRoot, then renders the App component wrapped in StrictMode for extra checks.