T
TanStack17mo ago
rare-sapphire

createLazyFileRoute or createFileRoute

Should i use createLazyFileRoute or createFileRoute, what is the difference?
3 Replies
other-emerald
other-emerald17mo ago
You shouldn't have to select between the two. When you have the dev server running and create a file in your routes folder, it should automatically decide and add in the boilerplate code for you. But to answer you question, its related to code-splitting, and how the critical and non-critical configuration comes into play.
other-emerald
other-emerald17mo ago
Code Splitting | TanStack Router React 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
rare-sapphire
rare-sapphireOP17mo ago
Thanks 👍

Did you find this page helpful?