← React Beginner Questions - Set 9 Q89

What is the difference between an uncontrolled and controlled component?

React Beginner Questions - Set 9

Example

<input value={name} onChange={e => setName(e.target.value)} />   {/* controlled */}
<input defaultValue="Ana" ref={nameRef} />                        {/* uncontrolled */}

What to notice

← Back to the question list