v2.0.0
What's new
Features
- Modals now can be layered! - #28
ModalWindow
has newserialized
propertyModalWindow
has newon
methodModalController
has newon
methodModalController
has newclose
methodModalController
has newshow
andhide
methods
Breaking changes
ModalWindow
now is aclass
instead ofinterface
Modal
is not exporting now, instead you should create your ownModal
usingModalController
ModalContainer
now has a required propertycontroller
id
property inModalWindow
is now anumber
instead ofstring
useModalContext
renamed touseModalWindow
observe
method inModalController
is renamed tosubscribe
andcallback
doesn't havestate
as an argument anymore - #142isClosed
property inModalWindow
is renamed toclosed
isFocused
property inModalWindow
is removed- Renamed
isOpen
toactive
inModalController
- Rename
ModalState
toModalSnapshot
- Rename
useModalState
touseModalSnapshot
What's Changed
- Update npm-publish.yml by @FrameMuse in #127
- Update package.json by @FrameMuse in #128
- Bump eslint from 8.38.0 to 8.39.0 by @dependabot in #132
- Bump @types/jest from 29.4.0 to 29.5.1 by @dependabot in #130
- Bump @types/react from 18.0.35 to 18.0.38 by @dependabot in #129
- Bump eslint-plugin-simple-import-sort from 7.0.0 to 10.0.0 by @dependabot in #110
- Fixed grammar in
README.md
by @FrameMuse in #133 - Bump sass from 1.62.0 to 1.62.1 by @dependabot in #134
- Bump @types/react from 18.0.38 to 18.2.6 by @dependabot in #139
- Bump type-fest from 3.8.0 to 3.10.0 by @dependabot in #138
- Bump eventemitter3 from 5.0.0 to 5.0.1 by @dependabot in #135
- Bump @rollup/plugin-typescript from 8.3.3 to 11.1.1 by @dependabot in #140
- Update
README.md
by @FrameMuse in #145 - Bump eslint from 8.39.0 to 8.41.0 by @dependabot in #148
- Bump type-fest from 3.10.0 to 3.11.0 by @dependabot in #147
- Bump tslib from 2.5.0 to 2.5.2 by @dependabot in #146
Full Changelog: v1.2.3...v2.0.0
Migration from v1.x.x
#1
Create local instance of ModalController
import { ModalController } from "react-modal-global"
export const Modal = new ModalController()
#2
Pass your local Modal
to ModalContainer
import Modal from "./Modal"
<ModalContainer controller={Modal} />
#3
Rename properies using your IDE or create a wrapper as dependency injection.