react props

JavaScript
class MyComponent extends React.Component{
    constructor(props){
        super(props);
    };
    render(){
        return(
            <div>
              <h1>
              	My First React Component!
              </h1>
            </div>
        );
    }
};
import React from 'react'; const App = () => {  const greeting = 'Hello Function Component!';   return <Headline value={greeting} />;}; const Headline = ({ value }) =>  <h1>{value}</h1>; export default App;function Welcome(props) {
  return <h1>Hello, {props.name}</h1>;
}

function App() {
  return (
    <div>
      <Welcome name="Sara" />      <Welcome name="Cahal" />      <Welcome name="Edite" />    </div>
  );
}

ReactDOM.render(
  <App />,
  document.getElementById('root')
);/* PASSING THE PROPS to the 'Greeting' component */
const expression = 'Happy';
<Greeting statement='Hello' expression={expression}/> // statement and expression are the props (ie. arguments) we are passing to Greeting component

/* USING THE PROPS in the child component */
class Greeting extends Component {
  render() {
    return <h1>{this.props.statement} I am feeling {this.props.expression} today!</h1>;
  }
}Props is a way to transform data from one component to another.
<Ball numbre = '1'/>
 //IN component
  {this.props.numbre} // in html is 1Props is a way to transform data from one component to another.
Source

Also in JavaScript: