For a plugin I\'m using I have to have a state that looks like this:
getInitialState() { return { invalid: true, access: { access_code: \'\',
Another way to do this would be
const newAccess = {...this.state.access}; newAccess.hospital_id = 1; setState({access: newAccess});
Use of the spread operator creates a clone of this.state.access.
this.state.access