BearCola
4/18/2019 - 9:45 PM

React props

class Hello extends React.Component {
  render() {
    return (
      <h1>
        Hi {this.props.to} from {this.props.from}
      </h1>
    );
  }
}

class App extends React.Component {
  render() {
    return (
      <div>
        <Hello to="Ringo" from="Paul" />
        <Hello to="Cher" from="Sonny" />
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById("root"));