React DOM

19.2.5 · active · verified Sat Apr 18

react-dom is the entry point for React applications when rendering to the DOM. It provides DOM-specific methods needed to manage and update the browser's DOM. The current stable version is 19.2.5. It receives frequent patch releases, often in sync with the `react` package and other related tools.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to render a basic React component into a DOM element using `createRoot`, the recommended method for React 18+ applications.

import { createRoot } from 'react-dom/client';
import React from 'react';

function App() {
  return <h1>Hello, React 19!</h1>;
}

const container = document.getElementById('root');
if (container) {
  const root = createRoot(container);
  root.render(<App />);
} else {
  console.error('Root element not found in the DOM.');
}

view raw JSON →