A controlled component is an input form element whose value is controlled by React
We should update state as soon as a user enters the information so that if they leave the page and come back or have a drop in connection, they could always get back to where they were at on the form.
The value of the input field
Personal Preferences but some of the reasons I’ve heard include the ability to create less lines of code and for other it was beause it was easier to understand what the code does.
Rewrite the following statement using a ternary statement:
//Original code
//if(x===y){
//console.log(true);
//} else {
// console.log(false);
// }
let boolean = (x === y ? true : false);
console.log(boolean);