Categories

Nov 26, 2019 in React JS
Q:

How to embed two components in One component?

1 Answer

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

Madanswer
Mar 2 in React JS
May 20 in React JS
Mar 1 in React JS
...