input type=”text”
data:
JSX:
function:
Achieved here it is equivalent to the v-model vue
jsx a defaultValue attribute syntax has, in fact, a native DOM attribute value in the
principle:
Model -> state in view of binding data by the attribute value, the rendering of the data view
View -> View monitor data model by changing the onChange event, in fact, listen and get defaultValue value
DefaultValue setState loaded into and through the state (defaultValue == e.target.value)
Data flow:
initStateData –> valueBind –> initViewData –> viewDataChange –> onChange –> getDefaultValue –> setStateData –> stateDataChange –> valueBind –> viewDataChange
input type=”radio”
data:
JSX:
function:
input type=”checkbox”
data:
JSX:
function:
Note that the application of extended operator, the role is a copy target hobbies
select>option
data:
JSX:
function:
effect: