An input form element whose value is controlled by React is called a “controlled component” it’s a form element, like an input or textarea, whose value is controlled by the component’s state. The value is set in the state and updated through event handlers, allowing React to be the single source of truth for the form’s value
when they submit, otherwise it’ll update every time the user types a letter
The value of the input field can be accessed using
event.target.value
within the event handler.
The Conditional (Ternary) Operator Explained
it’s more concise
Example
if(x===y){
console.log(true);
} else {
console.log(false);
}
Answer
console.log(x===y ? true : false)
React Bootstrap - Forms React Docs - conditional rendering