-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Description
I'm trying to implement a gallery that behaves like Instagram's, but I'm having trouble due to the fact that I can't change the URL without triggering a full re-route.
What I'd like to be able to do is open a modal from an image gallery and change the URL such that copying/pasting the URL results in displaying just that image and not the gallery behind it.
In other words, I have a set of routes that looks like this:
<Routes location="history">
<Route name="index" path="/" handler={App}>
<Route name="featuredGallery" path="/items/featured/" handler={FeaturedGallery} />
<Route name="itemDetail" path="/items/:id/" handler={ItemDetail} />
<DefaultRoute handler={Homepage} />
</Route>
</Routes>
And I'd like to be able to visit /items/featured/
and click an item to open a modal that changes the URL to, eg, /items/10/?modal=true
without triggering the ItemDetail
handler (I will render it inside the modal in FeaturedGallery
when an item in the gallery is clicked).
However, if /items/10/?modal=true
were to be pasted into a new browser window, it should trigger the ItemDetail
handler rather than FeaturedGallery
.
If there's a way to do this already, I haven't been able to figure it out. Any help is appreciated!