title: How to render a react component on every button click?
body: <p>Iam creating a react app in which i want to render a component on every button click.But i could do it only once.</p>
  
  <pre><code>class AddForm extends React.Component{
  constructor(props){
    super(props);
    this.state={
      anotherForm:false,
    }
    this.newForm=this.newForm.bind(this);
  }
  newForm(){
    this.setState({
      anotherForm:true
    })
  }
  render(){
  return(
    &lt;div&gt;
      &lt;button onClick={this.newForm}&gt;AddForm&lt;/button&gt;
      &lt;EducationDetails/&gt;
      {this.state.anotherForm?&lt;EducationDetails/&gt;:null}
    &lt;/div&gt;
  )
  }
  }
  </code></pre>
  
  <p>Here the component <code>EducationDetails</code> is to be rendered whenever the AddForm button is clicked.But i couldn't figure it out.</p>