Controlled and uncontrolled components are just different approaches to handling input form elements in react.
Feature |
Uncontrolled |
Controlled |
Name attrs |
One-time value retrieval (e.g. on submit) |
✔️ |
✔️ |
✔️ |
Validating on submit |
✔️ |
✔️ |
✔️ |
Field-level Validation |
❌ |
✔️ |
✔️ |
Conditionally disabling submit button |
❌ |
✔️ |
✔️ |
Enforcing input format |
❌ |
✔️ |
✔️ |
several inputs for one piece of data |
❌ |
✔️ |
✔️ |
dynamic inputs |
❌ |
✔️ |
🤔 |
Controlled component<span style="background-color:#f8fcf