title: Set State for variables inside object
body: <pre><code>constructor(props) {
      super(props)
  
      this.state = {
         per_name:'',
         per_email:'',
         person:{
             name:'',
             email:'',
             array:[]
          }
      }
  }
  
  this.setState({
   person:{
   name:this.state.per_name,
   email:this.state.per_email
  }
  })
  </code></pre>
  <p>I'm new to react if i try to setstate in this manner &quot;per_name is not defined&quot; error is thrown.
  How should state be set in such a case??</p>