score:4

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