score:0

class Hello extends React.Component {
    constructor() {
    super();
    this.state = {
        test: 'this is a test'
    }
  }

  render() {
    return <div>Hello {this.props.name}, {this.state.test}</div>
  }
}

const FunctionalHello = ({name}) => (
    <div>Hello {name}</div>
);

ReactDOM.render(
    <div>
      <Hello name="World" />
    <FunctionalHello name="World" />
    </div>,

  document.getElementById('container')
);

Related Query

More Query from same tag