A prop can be thought of as a parameter in that it changes the behavior (or output) of a component. Props can be passed to any component as they are declared for any HTML tag.
These props can be accessed in any component’s class using the syntax below:
this.props.MyProp
In the code below, we have passed a prop name
and location
from the parent to the child.
import React from 'react'; require('./style.css'); import ReactDOM from 'react-dom'; import App from './app.js';
Free Resources