perhaps you could create two routes, gallery and gallery/img/:id, that point to the same gallery component. then during componentwillmount of the gallery component you could check if the url contains an id param and decide to render the modal and which image to load.

you could then bookmark the ur, possibly remove for the modalswitch component entirely and also allow for redirecting a user back to the gallery route when closing the modal, keeping the url accurate at all times.

Related Query

More Query from same tag