import {confirm, Confirm, ConfirmNode} from 'react-confirm';
// Root
<Confirm />
// Event handler
confirm('hi');
// In case you need to check if it's open or not
<ConfirmNode onOpen={} onClose={} />
class ConfirmModal extends React.Component {
render() {
if (!this.props.open) {
return;
}
return (
<Modal>
{this.props.text}
</Modal>
)
}
}
export default Confirmable(ConfirmModal);
class ConfirmModal extends React.Component {
render() {
if (!this.props.open) {
return;
}
return (
<Confirm>
{(open, text, options) =>
<Modal>
{this.props.text}
</Modal>
)}
</Confirm>
)
}
}