How can you embed two or more components into one?
JAVASCRIPT
1// We can embed components into one in the following way:
2class MyComponent extends React.Component{
3 render(){
4 return( <div>
5 <h1>Hello</h1>
6 <Header/>
7 </div>);
8 }
9}
10
11class Header extends React.Component{
12 render(){
13 return
14 <h1>Header Component</h1>
15 };
16}
17
18ReactDOM.render(
19 <MyComponent/>, document.getElementById('content')
20);