← React Intermediate Questions - Set 12 Q115
What are controlled and uncontrolled components in React?
React Intermediate Questions - Set 12
Example
1
2
<input value={v} onChange={e => setV(e.target.value)} />
<input defaultValue={v} ref={r} />
What to notice
- One is a controlled value, the other an initial value read later.
← Back to the question list