in React JS by
Q:

How to embed two components in One component?

1 Answer

0 votes
by
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
asked Mar 2, 2020 in React JS by RShastri
0 votes
asked Dec 13, 2020 in Angular by SakshiSharma
0 votes
asked May 20, 2020 in React JS by SakshiSharma
0 votes
asked Jul 2, 2019 in React JS by Venkatshastri
+4 votes
asked Jul 31, 2019 in Agile by sheetalkhandelwal
...