props in a react class component code example
Example 1: props in react
function Welcome(props) {
return Hello, {props.name}
;
}
function App() {
return (
);
}
ReactDOM.render(
,
document.getElementById('root')
);
Example 2: react props
Props is a way to transform data from one component to another.
//IN component
{this.props.numbre} // in html is 1