Meta works on lazy routes despite TS screaming
Why does the Meta property work on the lazy route despite Typescript saying it doesn't exist?
Are there any issues with using the Meta prop on the lazy route and ignoring the type error?

4 Replies
correct-apricot•15mo ago
Its because the underlying implementation of createRoute, createFileRoute, createLazyRoute, and createLazyFileRoute are all based off of the base Route class.
We restrict what you can do at the type-level, do you don't put yourself into a situation where you are trying to lazily load in the critical route configuration.
correct-apricot•15mo ago
Critical vs non-critical route configuration: https://tanstack.com/router/latest/docs/framework/react/guide/code-splitting#how-does-tanstack-router-split-code
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
correct-apricot•15mo ago
That's why we've restricted the accepted properties on a type-level.
plain-purpleOP•15mo ago
Oh okay, thanks!!