Since personsState is immutable, you can't re-assign it. You have to set it with setPersonsState like you did in the other functions.
I see you need the previous state in order to do that (that's probably where your confusion came from). Apart from the object syntax of setState({...newState}) there is another syntax that takes a callback function: setState(previousState => { return {...newState} }). This is solved using this callback setState syntax.
This way, your togglePersonsHandler function would look like this:
const togglePersonsHandler = () => {
setPersonsState(previousPersonsState => {
const doesShow = previousPersonsState.showPersons;
return {
...previousPersonsState,
showPersons: !doesShow
};
});
};
Good luck!