are intercepting routes possible like in nextjs?
saw the nextjs implementation of showing a modal when you click on the link to certain routes but showing the whole page if refreshed and was wondering if there's something like that in router?
7 Replies
ratty-blushβ’11mo ago
you can do this with route masking
@tom did exactly that
wise-whiteOPβ’11mo ago
Just tried out route masking with file based and it seems to work but doesn't show the modal on top of the current data like in the docs demos
tigawanna
StackBlitz
Router Quickstart File Based Example (forked) - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

ratty-blushβ’11mo ago
https://stackblitz.com/edit/tanstack-router-z28vm4?file=src%2Froutes%2Flist%2F%24item%2F-ItemModal.tsx that's how we implemented it @tigawana
Tom KΓΌhl
StackBlitz
Router Quickstart File Based Example (forked) - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
ratty-blushβ’11mo ago
this way you can link from any page & always keep the page in the background
ratty-blushβ’11mo ago
a contribution to an example or the docs would be very much appreciated π
ratty-blushβ’11mo ago
will do as soon as we are live π«‘
wise-whiteOPβ’11mo ago
π thinks , do you have parallel route example, saw tanner say route masking can be used for that too