Search⌘ K
AI Features

ReactDOM

Explore how to use ReactDOM.render() to attach React components or JSX to HTML elements, bootstrapping your React application. Understand how this method connects the app to the HTML DOM and supports rendering multiple components efficiently.

We'll cover the following...

The App component is located in your entry point to the React world: the src/index.js file.

Javascript (babel-node)
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';
ReactDOM.render(
<App />,
document.getElementById('root')
);

ReactDOM.render() uses a DOM node in your HTML to replace it with JSX. It’s a way to integrate React in any foreign application easily, and you can use ReactDOM.render() multiple times across your application. You can use it to bootstrap simple JSX syntax, a ...