-
A controlled component is one whose data is handled by the component's state rather than the DOM.
-
Update the state as it is entered, because the displayed value is dependent on the state.
-
The event handler will have an event as a parameter; the user's entry can be targeted using
event.target.value
.
-
It provides a way to write an if-else statement in a single line of code.
-
x === y ? console.log(true):console.log(false);