When you build a large form in React, it's easy to fall into the trap of wiring every single input to a state variable via useState. You add an onChange handler, update the parent component, and watch the input feel responsive for small examples. Then your form grows to fifty fields, a table of line items, and a few conditional sections. Suddenly, typing into a text box feels sluggish. Every single keystroke forces the entire form container and all its sibling inputs to re-render. If you want to keep large forms fast, you need to stop synchronizing every keystroke with React state and trust the DOM instead.
You can read more about state placement strategies in Advanced Component State Colocation in React or explore alternative approaches like React Form State with Server Actions if you're piping data directly to backend handlers.
The Cost of Controlled Inputs in Large Forms
Controlled inputs require React to be the single source of truth for form data. Every time a user types a character, the browser fires an input event, your handler runs, state updates, and React schedules a re-rendering pass. For a simple login form with two fields, this overhead is negligible. For a dense administrative panel containing dozens of inputs, textareas, and select menus, that constant re-rendering cycle creates noticeable input lag.
You might try fixing this with memoization or by splitting components, but if the root state lives in the parent form component, changing a single input will still invalidate calculations and trigger tree traversals. You're fighting React's rendering model. Instead of adding complexity to bypass re-renders, you can avoid them entirely by letting the DOM manage the input values until the user actually submits the form.
State management in forms often suffers from premature optimization. Developers reach for global stores or heavy abstraction layers when the browser has already solved input persistence. The DOM retains values natively across user interactions without requiring JavaScript memory allocations on every keystroke. When you bypass this native capability, you're paying a performance penalty for zero architectural gain.
Consider what happens during a rapid typing test inside a controlled text area. Each keystroke triggers a reconciliation phase across the virtual DOM tree. If your form contains complex validation logic tied to that state, the main thread gets blocked processing intermediate, half-typed values that nobody cares about anyway. You only need the final value when the form dispatches. Uncontrolled components respect this reality by letting the browser handle the intermediate states entirely.
Using Native FormData for Submissions
Uncontrolled components let the browser hold the input values. You attach a ref only when you need programmatic focus or direct inspection, but for standard submissions, you don't even need refs. You can pass the native form event directly to the FormData constructor. This approach eliminates all change handlers and state setters for individual fields.
import React, { type FormEvent } from "react";
export function UserProfileForm() {
const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
const formData = new FormData(event.currentTarget);
const data = Object.fromEntries(formData.entries());
console.log(data);
};
return (
<form onSubmit={handleSubmit}>
<div>
<label htmlFor="username">Username</label>
<input id="username" name="username" type="text" defaultValue="johndoe" />
</div>
<div>
<label htmlFor="email">Email</label>
<input id="email" name="email" type="email" />
</div>
<button type="submit">Save Changes</button>
</form>
);
}Notice how clean that component is. There are no state hooks, no callback functions for input changes, and no unnecessary re-renders when typing. The browser tracks the string values inside each input natively. When the submit event fires, you extract everything at once. If you need stricter type safety on the resulting payload, you can check out Strict TypeScript Discriminated Unions for React Forms to parse and validate the shape of your form data.
Working with native form entries also simplifies file uploads and multi-value inputs like checkboxes and select multiples. A controlled file input in React requires awkward workarounds because you can't programmatically set its value due to security restrictions in the browser. Uncontrolled file inputs just work. You read them straight from the FormData instance without needing extra refs or custom change listeners.
Handling Complex Inputs and Validation
Moving away from controlled inputs raises a valid concern: how do you handle real-time validation or conditional fields? If an input value lives entirely in the DOM, checking its value on every keystroke requires querying the element or attaching a targeted ref. If you need live error messages or dependent fields that toggle visibility based on a checkbox, you can lift just that specific piece of state rather than the whole form.
Colocate state only where it's strictly required. If a checkbox toggles a billing address section, only the checkbox needs state. The inputs inside that billing section can remain completely uncontrolled until submission time. This hybrid model gives you interactive UI control where you need it while preserving maximum performance for the rest of the form fields.
import React, { useState, type FormEvent } from "react";
export function InvoiceForm() {
const [hasShippingAddress, setHasShippingAddress] = useState(false);
const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
const formData = new FormData(event.currentTarget);
const payload = {
billing: formData.get("billing"),
shipping: hasShippingAddress ? formData.get("shipping") : null,
};
console.log(payload);
};
return (
<form onSubmit={handleSubmit}>
<div>
<label htmlFor="billing">Billing Address</label>
<input id="billing" name="billing" type="text" required />
</div>
<label>
<input
type="checkbox"
checked={hasShippingAddress}
onChange={(e) => setHasShippingAddress(e.target.checked)}
/>
Ship to a different address
</label>
{hasShippingAddress && (
<div>
<label htmlFor="shipping">Shipping Address</label>
<input id="shipping" name="shipping" type="text" required />
</div>
)}
<button type="submit">Generate Invoice</button>
</form>
);
}By isolating the checkbox state, toggling the shipping fields only re-renders the wrapper around that specific checkbox and conditional input. The billing address input, which might be part of a large block of unrelated fields, stays untouched by the state change. Your typing performance stays snappy, your component trees remain shallow, and your code stays straightforward without complex memo caches.
Migrating legacy forms to this pattern takes patience, but you don't have to rewrite everything at once. Start by identifying the slowest form in your application using the React profiler during typing tests. Swap out the worst offenders first by dropping local change handlers and transitioning to native submission handlers. You'll immediately notice smoother frame rates and simpler component code.













