title: How to create new div after clicking a button in React,Js?
body: <p>I am new to React.JS. I need to make a button that creates a div with a child element every time the button is clicked. My current code does not create a new div whenever I click the button.</p>
  <p>Also how would I create a new div with a child div inside it in React Js?</p>
  <p>Here is my ReactJs code:</p>
  <pre><code> import React from 'react';
   import ReactDOM from 'react-dom';
   import './index.css';
  
   class CrudDivs extends React.Component {
  
      renderCrudDiv(){
        console.log('clicked')
        return (
          React.createElement(
            &quot;div&quot;,
            {className: &quot;crud-card&quot;},
            &quot;NewDiv&quot;,
          )
        )
      }
  
      render(){
  
        return (
  
          &lt;div className=&quot;crud-container&quot;&gt;
            &lt;div className = &quot;btnContainer&quot; &gt;
              &lt;button className = &quot;makeDivsBtn&quot;  onClick = {this.renderCrudDiv}&gt; 
                      Create Divs
              &lt;/button&gt;
            &lt;/div&gt;
          &lt;/div&gt; // container end 
          
        )
        
      }  
  }
  
  ReactDOM.render(&lt; CrudDivs /&gt; , document.getElementById('root'));
  </code></pre>