See React's rendering behavior in action. Watch components re-render, understand why they update, and learn optimization patterns.
Understanding how useState triggers re-renders
Turn on to record render events for this scenario.
1function Parent() {2 const [count, setCount] = useState(0);3 4 return (5 <div>6 <button onClick={() => setCount(c => c + 1)}>7 Increment8 </button>9 <ChildDisplay count={count} />10 </div>11 );12}13 14function ChildDisplay({ count }) {15 // Child re-renders when parent's state changes16 // because it receives the count as a prop17 return <div>Count: {count}</div>;18}When a parent component's state changes, React re-renders the parent AND all its children. This happens even if the children don't use the state directly.