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
}
})
I'm new to react if i try to setstate in this manner "per_name is not defined" error is thrown. How should state be set in such a case??