1.0.1 • Published 4 years ago
react-dialog-component v1.0.1
Install
npm install --save react-dialog-component
Usage
import { Dialog, useDialog } from 'react-dialog-component'
const MyComponent = () => {
const { dialogProps, onShowDialog } = useDialog()
const handleTestShowDialog = () => {
onShowDialog({
title: 'Do you Want to delete these items ?',
content: 'Some descriptions',
callbackOkDialog: () => {
console.log('callbackOkDialog => ')
},
callbackCancelDialog: () => {
console.log('callbackCancelDialog => ')
}
})
}
return (
<div>
<button onClick={handleTestShowDialog}></button>
<Dialog {...dialogProps} />
</div>
)
}