Controlled vs Uncontrolled in React

From the React Design Patterns cheat sheet ยท Component API Patterns ยท verified Jul 2026

Controlled vs Uncontrolled

Two ways to manage component state - let parent control, or manage internally

jsx
// Controlled - parent owns the state
<Input value={value} onChange={setValue} />

// Uncontrolled - component owns the state
<Input defaultValue="hello" ref={inputRef} />
๐Ÿ’ก Controlled = parent owns state; Uncontrolled = DOM/component owns state
โšก Building a component to support both is a common library pattern (Radix, MUI)
๐Ÿ“Œ React warns if you switch between controlled/uncontrolled - pick one and stick with it
๐ŸŸข react-hook-form leverages uncontrolled inputs for fewer re-renders on large forms
controlleduncontrolledforms

More React tasks

Back to the full React Design Patterns cheat sheet