← React Intermediate Questions - Set 2 Q19

What are controlled and uncontrolled components in React?

React Intermediate Questions - Set 2

Example

<input value={v} onChange={e => setV(e.target.value)} />   {/* controlled */}
<input ref={r} defaultValue={v} />                        {/* uncontrolled */}

What to notice

← Back to the question list