Props and State - 401-advanced-javascript-Mai/amman-javascript-401d1 GitHub Wiki

Props and State

Forms and Inputs

  • The creation of a parent component (which we’ll refer to as form-container), manages the state for all child components of the form and passes any necessary state down into it’s inputs through the use of props.
  • Each input has an onChange event that we can handle and use to update our form-container’s state each time the user interacts with an input.

Props

  • Components accept arbitrary inputs.
  • Props can be data or functions.