1.0.9 • Published 2 years ago

@cyberia-studio/react-modal v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Modal

Usage

import useModal, { useModalContext } from '@cyberia-studio/react-modal';

const Dialog: FC = () => {
    const {
        close,
        isOpen,
        open,
        set
    } = useModalContext();

    return <button onClick={close}>Please close me</button>
}

const Page: FC = () => {
    const [modal, modalControls] = useModal();

    const handleShowModal = () => modalControls.set(<Dialog />);

    return (
        <div>
            {modal}
            <h1>Modal block will be teleported to the root or body element</h1>
            <button onClick={handleShowModal}>
        </div>
    )
}
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago