Merge pull request #7660 from Tainan404/issue-7655
Handle dismiss prop being undefined.
This commit is contained in:
commit
f0d96a7571
@ -49,6 +49,7 @@ const defaultProps = {
|
||||
disabled: false,
|
||||
},
|
||||
dismiss: {
|
||||
callback: () => {},
|
||||
disabled: false,
|
||||
},
|
||||
preventClosing: false,
|
||||
|
@ -37,7 +37,12 @@ class ModalSimple extends Component {
|
||||
}
|
||||
|
||||
handleDismiss() {
|
||||
this.props.modalHide(this.props.dismiss.callback);
|
||||
const {
|
||||
modalHide,
|
||||
dismiss,
|
||||
} = this.props;
|
||||
if (!dismiss || !modalHide) return;
|
||||
modalHide(dismiss.callback);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
Loading…
Reference in New Issue
Block a user