1.0.9 • Published 11 months ago

@cyberia-studio/react-modal v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months 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

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago