Skip to content

Files

This branch is 3552 commits behind remix-run/remix:main.

route-modal

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 19, 2022
Feb 5, 2022
Mar 18, 2022
Mar 4, 2022
Feb 5, 2022
Jun 2, 2022
Apr 19, 2022
Feb 5, 2022
Mar 4, 2022
May 13, 2022

Route modal

Example of using routes to control visibility of modals.

Preview

Open this example on CodeSandbox:

Open in codesandbox

Example

This example shows how to use routes to show/hide modals.

Using routes has some advantages over useState or other state management solutions.

  • You can share links to open modals (eg. edit modal of a specific data row)
  • No need for state variables

This example uses @reach/dialog for displaying the modals.

Related Links

React Router v6 Modal example