T
TanStack6mo ago
correct-apricot

Is it possible to lazy load route tree instead of single lazy component?

According to the documentation at https://tanstack.com/router/latest/docs/framework/react/guide/code-splitting, I can create a lazy route with a component, but I want to lazy-load an entire nested route tree. Is that possible?
3 Replies
xenial-black
xenial-black6mo ago
you would need to lazy load each route of that tree individually are you using file based routing?
correct-apricot
correct-apricotOP6mo ago
No, file-based routing didn’t work for me — I have a lot of micro-frontend applications, and each one needs to load from a remote host and have its own router. React Router has functionality that's somewhat similar to what I need — lazy route discovery (fog of war). I’m trying to figure out whether there’s something similar in TanStack Router.
xenial-black
xenial-black6mo ago
no we don't have that yet

Did you find this page helpful?