📜  react js中受控组件和非受控组件之间的区别 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:53.502000             🧑  作者: Mango

代码示例1
In a controlled component, form data is handled by a React component. The alternative is uncontrolled components, where form data is handled by the DOM itself. To write an uncontrolled component, instead of writing an event handler for every state update, you can use a ref to get form values from the DOM.