react-hooks-modal

0.1.2 • Public • Published

react-hooks-modal

NPMVersion

React Hooks for Modal

Install

npm i react-hooks-modal

The Gist

import { useModal } from 'react-hooks-modal'
import { Button, Modal } from 'antd'
 
function App() {
  const { visible, show, hide } = useModal()
  return (
    <Button onClick={show}>Show Modal</Button>
    <React.Fragment>
      <Modal
        visible={visible}
        onClose={hide}
      >
        <span>A modal</span>
      </Modal>
    </React.Fragment>
  )
}

License

MIT © Randy

Readme

Keywords

none

Package Sidebar

Install

npm i react-hooks-modal

Weekly Downloads

1

Version

0.1.2

License

none

Unpacked Size

2.73 kB

Total Files

4

Last publish

Collaborators

  • djyde