This is my reading notes for Code Fellows.
1) What is a ‘Controlled Component’? A controlled component is a component that renders form elements and controls them by keeping the form data in the component’s state.
2) Should we wait to store the users responses from the form into state when they submit the form OR should we update the state with their responses as soon as they enter them? Why.
we should update state asap so it can be sent to other ui elements aswell.
3)How do we target what the user is entering if we have an event handler on an input field?
based on event. target.name
1) Why would we use a ternary operator?
changes the way you write if conditional statement and the answer should only be in boolean.
Rewrite the following statement using a ternary statement
let result = x === y ? console.log(“true”) : console.log(“flase”);