a1exlism
11/12/2017 - 9:26 AM

React_component_with_children

Refer

class Father extends Component {
  render() {
    return (
      <div id="father">
        {props.children}
      </div>
    );
  }
}

class App extends Component {
  render() {
    return (
      <div>
        <Father>I'm children.</Father>
        {/*OR with child component*/}
        <Father><Child/></Father>
        {/*OR single component*/}
        <Father/>
      </div>
    );
  }
}