modalRun = (state) => {
this.setState((prevState, state) => {
return {
modal: {
...prevState.modal,
state: state
}
};
});
};
<Button
onPress={() => this.modalRun(1)}
>
modalRun = (modalState) => {
this.setState((prevState) => {
return {
modal: {
...prevState.modal,
state: modalState,
},
};
});
}