Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.ui

Avoid mixing controlled and uncontrolled input props

Combining value with defaultValue leads to ambiguous ownership between React and the DOM.

#Metadata

Rule ID
ts.react.no-uncontrolled-to-controlled-input
Severity
medium
Confidence
0.88
Languages
javascript, typescript
Presets
strict
Stability
experimental
Applies to
function
Tags
react, rules-catalog, ui

#Why it matters

Inputs should be either controlled via value or bootstrapped once via defaultValue, not both at once.

#Remediation

Remove defaultValue when binding value, or drop value to stay fully uncontrolled.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-uncontrolled-to-controlled-input.rule.yaml.