TanStackT
TanStack•7mo ago•
29 replies
urgent-maroon

Specify the `component` dynamically, based on route context

hii
i have a use case in which i need to decide what component to render after fetching the data for the route.
how do you think it should be implemented?

currently, i'm thinking on using a code-based splitting approach. something like
.lazy(() => routeContext.first 
     ? import('first.lazy')... 
     : import('second.lazy')...
)

but using it doesn't look right for the file-based routes project šŸ¤”
Was this page helpful?