Pop-ups related to URL with React 16.8+ and watch-state.
npm
npm i @watch-state/react-router-modal
yarn
yarn add @watch-state/react-router-modal
All modals should be placed into Modals
.
import RouterModal, {Modals, OpenModal} from '@watch-state/react-router-modal'
import theme from '@watch-state/react-router-modal/theme/default.module.scss'
export default () => (
<>
<OpenModal id='test'>Open</OpenModal>
<Modals className={theme.modals}>
<RouterModal id='test' delay={300} classNames={theme}>
Test modal
</RouterModal>
</Modals>
</>
)
If you find a bug, please file an issue on GitHub