in React JS by
Q:

How to embed two components in One component?

▼ Show 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;
React JS
Learn More with Madanswer

Related questions

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