title: Can I write Component inside Component in React?
body: <p>I have come across many sources which talk about how to do <code>Component</code> nesting. However, whenever I try to create a <code>Component</code> inside another <code>Component</code> my code fails.</p>
  
  <pre><code>class parent extends React.Component{
      class child extends React.Component{
          render(){
              return &lt;div&gt;&lt;h1&gt;Hiiii&lt;/h1&gt;&lt;/div&gt;;
          }
      }
      render(){
          return &lt;div&gt;&lt;DEF /&gt;&lt;/div&gt;;
      }
  }  
  </code></pre>