You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a page with a list of items, let's say /products. Clicking on a product navigates to a page /products/:productId. I'm using route loaders in both cases.
By clicking on the list, the product should be opened in a modal component over the list. I did this by using the Outlet component and useMatchRoute.
What I want to achieve is to differentiate the case of a click on the list from the case of navigation to /products/:productId from wherever else, so I can render a modal or a full page.
And a step farther: navigating from wherever else, the default behavior of waiting until route loader finishes is perfect. But clicking on the list should open the modal instantly and then retrieve the data.
Can someone provide some advice or guidance on this?
Thanks in advance.
EDIT:
I'm investigating how to use the from param, but I think is not what I'm looking for. Maybe some kind of meta param would be useful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm struggling with a situation:
I have a page with a list of items, let's say /products. Clicking on a product navigates to a page /products/:productId. I'm using route loaders in both cases.
By clicking on the list, the product should be opened in a modal component over the list. I did this by using the
Outlet
component anduseMatchRoute
.What I want to achieve is to differentiate the case of a click on the list from the case of navigation to /products/:productId from wherever else, so I can render a modal or a full page.
And a step farther: navigating from wherever else, the default behavior of waiting until route loader finishes is perfect. But clicking on the list should open the modal instantly and then retrieve the data.
Can someone provide some advice or guidance on this?
Thanks in advance.
EDIT:
I'm investigating how to use the
from
param, but I think is not what I'm looking for. Maybe some kind ofmeta
param would be useful.Beta Was this translation helpful? Give feedback.
All reactions