You get a bonus - 1 coin for daily activity. Now you have 1 coin

What are props in React? in REACT

Practice



props

Props are the input data for components. They are individual values or objects containing a set of values that are passed to components on creation, using a naming convention similar to HTML tag attributes. This is data passed from a parent component to a child component.

The main purpose of props in React is to provide the following component functionality:

  1. Pass custom data to your component.
  2. Trigger state changes.
  3. Use the method
    this.props.reactProp
    inside the component's
    render()
    .

For example, let's create an element with a

reactProp
property:
<Element reactProp={'1'} />
 

This

reactProp
(or whatever name you come up with) becomes a property attached to React's own props object, which already exists natively on all components created using the React library.
props.reactProp

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone