Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 877 Bytes

File metadata and controls

27 lines (21 loc) · 877 Bytes

code fellows 301

Read: 04 - React and Forms

Reading

  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.
  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);