What are props in React


Props in react is just like argument in function is. You pass some usefull data between components to communicate. The primary purpose of props in React is to provide following component functionality:

  • Pass custom data to your component.
  • Trigger state changes.
  • Use via this.props.reactProp inside component's render() method.
  • Example:

    <Component name = 'yourname'>