reading-notes

code fellows reading notes

View on GitHub

Reading-Notes

code fellows 301

Read: 04 - React and Forms

Reading

React Docs - Forms

  1. A controlled component is a component that renders from elements and controls them by keeping the form data in the component’s state.
  2. We update the state with their responses as soon as they enter them to update the react state and other UI elements at the same time.

The Conditional (Ternary) Operator Explained

  1. You use a ternary operator in place of an if statement.
  2. Rewrite the following statement using a ternary statement:
    if(x===y){
     console.log(true);
      } else {
     console.log(false);
      }
    
let ans = (x===y) ? true : false

console.log(ans);