File-based router open dialog in parent route
Hi, I'm trying to popup a dialog(/example/new) while keeping the parent content(/example) in the background, and I placed a <Outlet /> in the index.lazy.tsx,
but it not working, it just render the /example/new 's content.
What should I change to do so?
Here is my router file structure
4 Replies
sensitive-blueOP•15mo ago
After some trial, I found the following will work fined, but still looking soluation for the original structure(looks cleaner:))
deep-jade•15mo ago
Have you tried naming
example/index.lazy.tsx
to example/route.lazy.tsx
?
Naming example/route.tsx
is the same as example.tsx
(but not example/index.tsx
) so I would assume it works the same when appending .lazy
deep-jade•15mo ago
You can read more about the
.route
file naming convention in the docs:
https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing#file-naming-conventionsFile-Based Routes | TanStack Router React Docs
Most of the TanStack Router documentation is written for file-based routing. This guide is mostly intended to help you understand in more detail how to configure file-based routing and the technical details behind how it works.
Prerequisites
sensitive-blueOP•15mo ago
.route works the best, thx.