← Week 7 — 13 / 16 →

Lab 7: React Tic Tac Toe

Props

State

  • useState makes a bargain with React: I promise to only update the state with the assigned setter method, and React promises to efficiently re-render my component and its children.
  • Update with this.setState()
  • When you call setState in a component, React automatically updates the child components inside of it too.
  • To let child components modify state, pass a handler function down to them as one of their props.