Tradeoff: Extra Re-renders
You'll learn: Why controlled components trigger more renders than uncontrolled ones, and what that means for your app's performance.
The Performance Cost of Control
When you use a controlled component, every single keystroke triggers a complete re-render of your component. Type "hello" in a controlled input? That's five state updates and five re-renders—one for each letter.
Here's what happens on each keystroke:
- User types a character
onChangefiressetStateschedules an update- React re-renders the component
- The new value appears in the input
This is the price you pay for the single source of truth pattern. Because state drives the DOM (not the other way around), React must re-render to keep them in sync.
Is This Actually a Problem?
For most forms, no. React's rendering is highly optimized, and a simple form component re-rendering is incredibly fast (usually under 1ms). You won't notice any lag.
However, re-renders can become noticeable if:
- Your component tree is large and complex
- You're doing expensive calculations during render
- You have many controlled inputs updating simultaneously
- You're performing synchronous DOM measurements
The Tradeoff in Context
You get immediate validation, formatting, and programmatic control—but you pay with extra render cycles. It's a conscious tradeoff: more renders in exchange for more power and predictability.
Later, you'll learn optimization techniques (like debouncing, memoization, and splitting components) if these extra renders ever become a bottleneck. But start with controlled components by default—premature optimization is far worse than a few extra renders.
Key Takeaway: Controlled components re-render on every keystroke, but this performance cost is usually negligible and worth the benefits of having state drive your UI.