Skip to content

Releases: trendmicro-frontend/react-modal

v3.1.0

13 Dec 10:59
5737405
Compare
Choose a tag to compare

This release provides React Context and Hook API support.

Context API

<ModalProvider>
    <ModalRoot />
    <ModalConsumer>
        {({ openModal, closeModal }) => {
            const handleClick = (e) => openModal(MyModal);
            return (
                <Button onClick={handleClick}>
                    Open Modal
                </Button>
            );
        }}
    </ModalConsumer>
</ModalProvider>

Hook API

const Example = (props) => {
    const { openModal, closeModal } = useModal();
    const handleClick = (e) => openModal(MyModal);

    return (
        <Button onClick={handleClick}>
            {props.children}
        </Button>
    );
}

v3.0.0

01 Jan 14:15
dd162d2
Compare
Choose a tag to compare

There are a few breaking changes in this release and requires upgrading React to 16.3.

v2.3.0

27 Dec 10:49
5d45dbc
Compare
Choose a tag to compare

Add support for using ReactDOM.createPortal() in React 16 (5d45dbc, PR #3)

v2.2.2

07 Aug 11:14
Compare
Choose a tag to compare

Change "white-space: initial" to "white-space: normal" to address browser compatibility issue (ef7ac9d)

v2.2.1

01 Aug 09:53
Compare
Choose a tag to compare

Resets the white-space property to initial for modal content (ff2e17f)

v2.2.0

01 Aug 09:15
Compare
Choose a tag to compare

Do not wrap the modal content if it cannot fit the viewport width (47e8018)

v2.1.2

05 Jul 09:00
Compare
Choose a tag to compare

Fixes an issue of passing unknown prop onClose on <div> tag (ef59f54)

v2.1.1

01 Jun 01:45
Compare
Choose a tag to compare

Use image to display close icon at right corner.

v2.1.0

27 Mar 11:41
Compare
Choose a tag to compare

Address an issue where IE 11 cannot recognize "text-align: initial" (ea13c09)

v2.0.5

22 Mar 08:35
Compare
Choose a tag to compare

Fixed a bug where the size prop does not work as expected with 'extra-small', 'small', 'medium', 'large' (29e11ee)