Rendering (React)

Rendering is the process by which React calls your components to produce the UI and then updates the screen to match. React re-renders a component whenever its state or props change.

React

A render is React calling your component function to figure out what should appear on screen. The first render is the initial paint; afterward, React re-renders a component when its state changes or it receives new props.

Importantly, a re-render doesn't mean the whole page is rebuilt — React computes what changed using the Virtual DOM and updates only the affected parts of the real page. Rendering should be pure: a component should just calculate JSX from its inputs, with side effects kept inside useEffect or event handlers.

Examples

JSX — Each keystroke updates state, causing React to re-render the component so the input shows the latest typed value.

import { useState } from "react";

function Name() {
  const [name, setName] = useState("");
  // This function re-runs (re-renders) on every keystroke
  return <input value={name} onChange={e => setName(e.target.value)} />;
}

Learn it in a lesson

See also

Back to the Dictionary