davidmfoley / react-router-modal

Simple modals for react-router 4
MIT License
153 stars 20 forks source link

Make a modal route mount last #33

Open CptMaumau opened 5 years ago

CptMaumau commented 5 years ago

Hi, would it be possible to make a ModalRoute always mount last via a prop? For example for when you need the modal behind to finish loading before mounting the front one.

davidmfoley commented 5 years ago

The stacking order is controlled by:

  1. For <Modal> components, one can specify stackOrder -- see: https://github.com/davidmfoley/react-router-modal#modal. If not specified, the modals will be stacked in the order that they mount.

  2. If you have two or more <ModalRoute> components mounted, they are stack-ordered based on the length of the match to the location: so that a ModalRoute that matches /foos/42/details sits "on top" of one that matches just /foos/42.

What is the behavior you are seeing? If you post a code example perhaps I can help.