【发布时间】:2020-10-04 10:29:51
【问题描述】:
我有一个可重复使用的对话框。我只有一个对话框用于确认注销和删除。
我的问题是注销,一旦我确认注销,触发的操作就是删除。
我放了一个 console.log console.log("SUCCESS LOGOUT") console.log("DELETE USER SUCCESS"); 来查看是否成功触发了哪些操作及其删除操作。我将如何解决这个问题?谢谢。
查看此链接
对话框
const ReusableDialog = ({
title,
details,
open,
type,
onAgree,
onDisagree
}) => {
return (
<div>
<Dialog
open={open}
TransitionComponent={Transition}
keepMounted
onClose={onDisagree}
aria-labelledby="alert-dialog-slide-title"
aria-describedby="alert-dialog-slide-description"
>
<DialogTitle id="alert-dialog-slide-title">
<span>
Are you sure you want to {title} {details?.name}
</span>
</DialogTitle>
<DialogActions>
<Button variant="contained" size="small" onClick={onDisagree}>
Cancel
</Button>
<Button variant="contained" size="small" onClick={onAgree}>
Confirm
</Button>
</DialogActions>
</Dialog>
</div>
);
};
export default ReusableDialog;
【问题讨论】:
标签: javascript reactjs redux react-redux react-material