reading-notes

Code Fellows courses Notes

This project is maintained by QamarAlkhatib

React and Forms

  1. What is a ‘Controlled Component’?

  1. 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.

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

after adding the setState on the ChangeInput function, we can target the event as event.target.value


The Conditional (Ternary) Operator Explained

  1. Why would we use a ternary operator?
  1. Rewrite the following statement using a ternary statement:
  if(x===y){
    console.log(true);
  }else {
    console.log(false);
  }

Using ternary statment:

x===y ? true : false;

Things I want to know more about