Controlled Component là component mà giá trị của form element (input, textarea, select) được kiểm soát bởi React state.
- Mỗi thay đổi của input gọi onChange handler để cập nhật state, và value của input được bind với state.
- Đây là cách được khuyến nghị vì cho phép validate và xử lý dữ liệu trước khi submit.
A Controlled Component is one where the value of a form element (input, textarea, select) is fully controlled by React state.
- Every change in the input triggers an onChange handler that updates state, and the input's value is bound back to that state.
- This is the recommended approach because it lets you validate and transform data before submission.