Course contentsShow
← React
Lesson 1199 of 2,39631. Forms in ReactFree lesson

When Uncontrolled is Right: Simple Forms and File Inputs

Recognizing cases where uncontrolled components are preferable: basic forms, file uploads, and performance-sensitive inputs.

When Uncontrolled is Right: Simple Forms and File Inputs

You'll learn when to skip React state and let the DOM handle form data itself.

The Core Idea

Not every form needs React state. Uncontrolled components shine in three scenarios: simple forms without validation, file uploads, and performance-sensitive inputs. If you're just collecting data on submit—no real-time validation, no conditional rendering based on input—why pay the re-render cost? Let the DOM do what it does naturally: hold input values.

When to Choose Uncontrolled

1. Basic Forms

If you only read values on submit (like a contact form), controlled components add unnecessary complexity. Grab the data with ref.current.value when you need it.

2. File Inputs

File uploads are always uncontrolled—you literally cannot set a file input's value programmatically for security reasons. The DOM must manage the file reference. Use a ref to access files property on submit.

3. Performance-Sensitive Inputs

Typing in a controlled input triggers a re-render per keystroke. For large forms or slow devices, this adds up. Uncontrolled inputs skip the React reconciliation cycle entirely until you explicitly read the values.

The Mental Model

Think of controlled components as a two-way walkie-talkie: every keystroke goes up to React, React sends it back down. Uncontrolled is a suggestion box: you only peek inside when you need the accumulated content.

Key Takeaway: Use uncontrolled components for simple submit-only forms, file uploads (mandatory), and when keystroke re-renders hurt performance. You trade real-time control for simplicity and speed.