prop react js code example
Example 1: react props
Props is a way to transform data from one component to another.
<Ball numbre = '1'/>
//IN component
{this.props.numbre} // in html is 1
Example 2: props react
function Welcome(props) { return <h1>Hello, {props.name}</h1>;
}
const element = <Welcome name="Sara" />;ReactDOM.render(
element,
document.getElementById('root')
);