Skip to content

Instantly share code, notes, and snippets.

@unlight
Last active April 9, 2022 13:09
Show Gist options
  • Save unlight/a89b3a4a4cb7dbf19f7eb2a2842c6206 to your computer and use it in GitHub Desktop.
Save unlight/a89b3a4a4cb7dbf19f7eb2a2842c6206 to your computer and use it in GitHub Desktop.
react router modal

https://github.com/Mayowa-Ojo/routable-modal
2/5 плохо (для каждого модальной страницы нужно создавать, нельзя передать компонент)

https://github.com/davidmfoley/react-router-modal
https://davidmfoley.github.io/react-router-modal-examples/
4/5
можно определить контейнер
есть специальные компоненты (ModalLink)
работает только с react-router-dom

https://github.com/codedailyio/ReactRouterModal
5/5
простое чистое решение (но более низко уровневое)
через createPortal <div id="modal_root"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment