Demo http://ui.talk.ai/react-stack-modal
Ideas behind this component: New modal built for React called react-stack-modal
State of modals and popovers are managed inside the store, so Controller will have full access to modals and it makes sophisticated logics possible. And the cost is we need quite some boilerplate code.
This component is based on actions-recorder.
npm i --save react-stack-modalSteps to use this modal:
- Setup
actions-recorder - Setup
modalStack: []in store as the default modal list - Connect actions
modal/add modal/remove modal/content-clicktoupdater/modal.coffee - Mount
ModalStackin component tree and wire up events - Pick what you need in
main.cssand add in your project
Browse app/ folder for details. Well this is a library designed for heavy use of modals and popovers. It may be over complicated.
autoFocus: truemay break entering transition, addrequestAnimationFrameto bypass.
Project template:
https://github.com/teambition/coffee-webpack-starter
MIT