Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteIn React, a controlled component gets an important value from props, while an uncontrolled component keeps that value in its own state. For native form fields, the practical distinction is whether you provide value or checked for the current value, or use defaultValue or defaultChecked only to set the starting value.
Use controlled state when React needs to respond to each edit or coordinate the value across the interface. Use an uncontrolled field when the value can stay in the DOM until you need it, such as when submitting a form. These labels are useful design shorthand, not rigid categories: a component can combine parent-driven props and local state.
What is the difference between controlled and uncontrolled components in React?
The distinction is about where important state lives and who can change it. React describes a component as controlled when important information is driven by props, and uncontrolled when it keeps that information in its own local state. A parent can specify a controlled child’s behavior; an uncontrolled child needs less configuration from its parent but is harder to coordinate with other components. See React’s guide to sharing state between components.
| Question | Controlled | Uncontrolled |
|---|---|---|
| Where is the current value? | In React state, typically owned by a parent and passed to the field as a prop. | In the field’s current DOM value. |
| How much coordination is possible? | React can use each edit to update other components or interface elements. | The parent does not need to configure every edit, but other UI cannot automatically coordinate from React state. |
| What must be configured? | A current value and an event handler that updates it. | Usually less configuration; an initial value can be supplied if needed. |
| How is the value read on submit? | Read the value from React state. | Read a named field from the form using FormData. |
| What constraints apply? | Update the backing state synchronously and keep the value’s type stable. | Do not later switch the field to controlled mode. |
These general component-design terms should not be confused with React’s specific rules for native <input>, <select>, and <textarea> elements. Those fields have explicit controlled and initial-value props.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
What’s the difference between value and defaultValue?
For a text input, value sets the current value from React. The field is controlled, so it needs an onChange handler that synchronously updates the backing value. defaultValue sets only the initial text; after that, the field’s current value is held by the DOM. React documents these rules in its <input> reference.
const [name, setName] = useState('');
<input value={name} onChange={event => setName(event.target.value)} />
Here, the handler immediately updates state to match the edit. If a controlled field rerenders with its previous value because the handler did not update the state synchronously, the typed character can appear to revert.
<input name="name" defaultValue="Taylor" />
This field starts with “Taylor,” but its current value is not controlled by React state. The name makes it available when reading form data.
Checkboxes and radio buttons use checked props
For a controlled checkbox or radio, use checked for its current selection and update it synchronously in onChange. Use defaultChecked to specify only the initial selection. value is not a substitute for checked state; it represents a different aspect of the form control.
Rank #3
Select menus and textareas
For a <select>, value controls the current selection and defaultValue sets the initial selection. For a multiple-select menu, either prop can take an array of strings. Set selection on the parent <select>, not with a selected prop on an individual <option>. A <textarea> follows the same controlled-versus-initial pattern: value controls its text, while defaultValue supplies initial text. Controlled textareas also need a synchronous update handler. Consult React’s references for <select> and <textarea>.
Keep a field in one mode
A native field must not switch between controlled and uncontrolled during its lifetime. For example, avoid rendering value={undefined} and supplying a string later. Initialize controlled text state to '', or normalize nullable data so the prop remains a string. A controlled checkbox should receive a boolean value for checked.
Rank #4
When should I use controlled or uncontrolled components?
Choose controlled state when the interface must react to edits
Make a value controlled when other parts of the interface need to respond as the user types, when more than one action can change it, or when multiple components must stay synchronized. For example, controlled state is useful for showing live validation or a preview, mirroring text in another field, or changing a field from a button. The parent passes the current value and an update handler to the child.
Choose uncontrolled state when the value is only needed later
An uncontrolled field fits when the parent does not need each edit and can read the value when the user submits the form. React’s form guidance shows reading named fields with new FormData(form). For example:
Best Value
function handleSubmit(event) {
event.preventDefault();
const formData = new FormData(event.currentTarget);
const name = formData.get('name');
}
<form onSubmit={handleSubmit}>
<input name="name" defaultValue="Taylor" />
<button type="submit">Save</button>
</form>
With a controlled field, use the state variable instead of reading its current value from FormData. React also documents that function form actions reset uncontrolled fields; see the <form> reference.
How do I keep two React inputs in sync?
Put the shared value in the closest common parent of the inputs, then pass that value and update handlers down to both. This is called lifting state up: the parent becomes the single source of truth for that piece of information.
function Parent() {
const [text, setText] = useState('');
return (
<>
<input value={text} onChange={event => setText(event.target.value)} />
<input value={text} onChange={event => setText(event.target.value)} />
</>
);
}
Both fields receive the same current value, and either field’s handler updates it. Avoid keeping separate copies of the shared value in the two children: those copies can diverge.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →




