๐๐ผ๐ป๐๐ฟ๐ผ๐น๐น๐ฒ๐ฑ ๐๐ ๐จ๐ป๐ฐ๐ผ๐ป๐๐ฟ๐ผ๐น๐น๐ฒ๐ฑ ๐๐ผ๐บ๐ฝ๐ผ๐ป๐ฒ๐ป๐๐
You manage form data in React in two ways.
Controlled components:
- React owns the state.
- You use value and onChange.
- You control every change.
- Use these for validation.
Uncontrolled components:
- The DOM owns the state.
- You use refs to pull values.
- It works like standard HTML.
- Use these for simple forms.
Pick the tool for your job.
Source: https://dev.to/vishwajeet81/controlled-vs-uncontrolled-component-1ggm