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