1.0.1 • Published 4 years ago

react-dialog-component v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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