Recall & Review
beginner
What is the role of ReactDOM in a React application?
ReactDOM connects React components to the actual web page by rendering them into the browser's DOM. It acts like a bridge between React's virtual elements and the real HTML elements you see.
Click to reveal answer
beginner
What does the ReactDOM.render() function do?
ReactDOM.render() takes a React component or element and displays it inside a specified HTML element on the page. It updates the page content to match the React component's output.
Click to reveal answer
intermediate
Why does React use a virtual DOM during the render process?
React uses a virtual DOM to quickly compare changes in components without touching the real DOM often. This makes updates faster and smoother, like planning changes on paper before painting a wall.
Click to reveal answer
intermediate
What happens when ReactDOM.render() is called multiple times on the same container?
ReactDOM replaces the previous content inside the container with the new React component's output. It updates only what changed, keeping the page efficient and responsive.
Click to reveal answer
advanced
How does ReactDOM hydrate() differ from ReactDOM.render()?
ReactDOM.hydrate() is used to attach React's event handlers to existing HTML generated by server-side rendering, instead of creating new content. It helps React take over a server-rendered page smoothly.
Click to reveal answer
What is the main purpose of ReactDOM.render()?
✗ Incorrect
ReactDOM.render() shows React components inside a specified HTML element on the page.
Why does React use a virtual DOM?
✗ Incorrect
The virtual DOM lets React compare changes quickly and update the real DOM efficiently.
What does ReactDOM.hydrate() do?
✗ Incorrect
hydrate() connects React to HTML already rendered on the server, enabling interactivity.
If ReactDOM.render() is called twice on the same container, what happens?
✗ Incorrect
ReactDOM.render() replaces the old content with the new component inside the container.
Which of these is NOT a part of the ReactDOM render process?
✗ Incorrect
ReactDOM render process does not directly modify CSS styles; styling is handled separately.
Explain the steps ReactDOM takes when rendering a React component into the browser.
Think about how React updates the page efficiently using virtual DOM.
You got /5 concepts.
Describe the difference between ReactDOM.render() and ReactDOM.hydrate() and when to use each.
Consider server-side rendering and client-side rendering scenarios.
You got /4 concepts.