Forms look simple in React—until they aren’t.

If you’ve ever wondered:

  • Why is my input re-rendering so much?
  • When should I use useRef instead of useState?
  • What do interviewers actually expect here?

This article breaks down controlled vs uncontrolled forms in React with practical use cases, not just definitions.


What Is a Controlled Form?

A controlled form is one where React controls the input value. The input’s value lives in React state, and every change goes through an onChange handler.

Example: Controlled Input

import { useState } from "react";

function ControlledForm() {
const [email, setEmail] = useState("");

return (
<form>
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="Enter email"
/>
<p>Email: {email}</p...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help