djorg83 / react-bootstrap-sweetalert

A React implementation of SweetAlert

Home Page:https://djorg83.github.io/react-bootstrap-sweetalert/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warning: Failed prop type: The prop `onConfirm` is marked as required in `SweetAlert`, but its value is `undefined`.

harishmahajan opened this issue · comments

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>

Please include a sample of your usage

sample added above

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 })}
/>