On delete click I'm calling a modal dialog, and updating the 'userid' state with corresponding userid of deleting member. setState function not updating the value. How can I achieve this in any other way.
delete click handler
handleClickDialogOpen = (userid) => {
this.setState((state) => {
return {
open: true,
UserID: userid,
};
});
console.log(this.state)
};
and within modal dailog, on delete button i cannot get the value of userId
<Button onClick={() => deleteSP(this.state.userID)} className={classes.agree}>
Delete
</Button>
How can I pass the Id for 'deleteSP'