T
TanStack16mo ago
harsh-harlequin

lazyRouteComponent or createLazyRoute

Which one is recommended?
3 Replies
wise-white
wise-white16mo ago
One is for code based routing and one is for file based routing
harsh-harlequin
harsh-harlequinOP16mo 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
fascinating-indigo
fascinating-indigo16mo ago
You can use createLazyRoute for the code-based approach. You'll basically be replicating the file-based routing approach but manually doing the connections using code-based.

Did you find this page helpful?