Warning: Failed prop type: The prop `onConfirm` is marked as required in `SweetAlert`, but its value is `undefined`.
harishmahajan opened this issue · comments
harish mahajan commented
I used
<SweetAlert
warning
showCancel
confirmBtnText="Yes, delete it!"
confirmBtnBsStyle="danger"
cancelBtnBsStyle="default"
title="Are you sure?"
onConfirm={this.deleteFile}
onCancel={this.cancelDelete}
>
You will not be able to recover this imaginary file!
</SweetAlert>
Daniel Jorgensen commented
Please include a sample of your usage
harish mahajan commented
sample added above
harish mahajan commented
solved by doing this.
<button onClick={() => this.setState({ show: true })}>Alert
<SweetAlert
show={this.state.show}
title="Demo"
text="SweetAlert in React"
onConfirm={() => this.setState({ show: false })}
/>