Nov 26, 2019 in React JS
Q:

How to embed two components in One component?

1 Answer

0 votes
Nov 26, 2019
import React from 'react';

class App extends React.Component{

    render(){

        return(

            <div>

            <Header/>

            <Content/>

            </div>

        );

    }

}

class Header extends React.Component{

    render(){

        return(

            <div>

            <h1> Header</h1>

            </div>

        )

    }

}

class Content extends React.Component{

    render(){

        return(

            <h2>Content</h2>

            <p>The Content Text!!!</p>

            </div>

        )

    }

}

export default App;
Click here to read more about React JS
Click here to read more about Insurance

Related questions

0 votes
Jan 9, 2020 in Vue.JS
  • #vue
  • #vuejs
  • #vue-installation
0 votes
Jul 24, 2020 in Ionic
...