reading-notes


Project maintained by Razan-am Hosted on GitHub Pages — Theme by mattgraham

React Docs - Forms

What is a Controlled Component?

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.

How do we target what the user is entering if we have an event handler on an input field?


The Conditional (Ternary) Operator Explained

Why would we use a ternary operator?

Rewrite the following statement using a ternary statement:

if(x===y){

console.log(true);

} else {

console.log(false);

}


References:

@React/Forms

@Brandon Morelli/JavaScript — The Conditional (Ternary) Operator Explained