Skip to main content

[react] Props

  • Every parent component can pass some information to its child components by giving them props.
  • Props are read-only snapshots in time: every render receives a new version of props.
  • You can’t change props. When you need interactivity, you’ll need to set state.
  • Context lets a parent component provide data to the entire tree below it.

參考資料 1: React.dev