0.0.6 • Published 3 years ago

rc-modal-manager v0.0.6

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

react-modal-manager

Usage

import { Button, Modal } from 'antd'
import ReactModalManager, { showModal, closeModal } from '@momenta/react-modal-manager'

...

const DemoModal = ({ id, closeModal }) => (
  <Modal title="Basic Modal" visible={true} onOk={closeModal} onCancel={closeModal}>
    <p>Content...</p>
  </Modal>
)



const App = () => (
  <div>
    <Button onClick={() => showModal(<DemoModal />)}>Show Modal</Button>
    <ReactModalManager />
  </div>
)

ReactDOM.render(<App />, document.getElementById('root'))

or

const modalId = showModal(<DemoModal />)
closeModal(modalId)

...