index.tsx vs index.route.tsx
I'm reading this part: https://tanstack.com/router/latest/docs/framework/react/guide/code-splitting#encapsulating-a-routes-files-into-a-directory
Specifically:
For example, if you have a route file named posts.tsx, you would create a new directory named posts and move the posts.tsx file into that directory, renaming it to index.route.tsx.What's the difference between naming the file index.tsx and index.route.tsx? The end result is the same, I still get the route on /posts/ and not /posts
Code Splitting | TanStack Router Docs
Code splitting and lazy loading is a powerful technique for improving the bundle size and load performance of an application.
Reduces the amount of code that needs to be loaded on initial page load
1 Reply
wise-whiteOP•2y ago
also the example in the section seems kinda unrelated (or am I missing something here)
