Class Four Notes (301)
- Controlled Component: An input form element whose value is controlled by React
- The state is updated as soon as the user has an input, so the displayed value of state will be updated as the user types
- The user’s input can be updated by tageting the input value
The conditional (Ternary) Operator Explained[^2]
- A ternary operator shortens a conditional statement
if(x===y){
console.log(true);
} else {
console.log(false);
}
- the above code can be re-written as:
x===y ? console.log(true) : console.log(false)
Back to main page
References
[^2]