125
rated 0 times
[
127]
[
2]
/ answers: 1 / hits: 45552
/ 9 Years ago, fri, january 22, 2016, 12:00:00
For a plugin I'm using I have to have a state that looks like this:
getInitialState() {
return {
invalid: true,
access: {
access_code: '',
zipcode: '',
password: '',
confirm: '',
hospital_id: '',
},
}
},
How would I set the state of hospital_id without setting the rest of access?
This seems to remove everything but hospital_id:
this.setState({access: {hospital_id: 1}})
More From » reactjs