State & Props

Value from Props: 0

Note-wise Points:

State:

  • Definition: State is a way to store and manage data within a component that can change over time.
  • Usage: It is used to store data that can change based on user interaction or other factors, and it causes the component to re-render when updated.

Props:

  • Definition: Props (short for properties) are read-only values passed from a parent component to a child component.
  • Usage: They allow components to communicate with each other and pass data or functions down the component tree.