[tanstack router docs] path option missing from createFileRoute functions in docs
Which project does this relate to?
Router
Describe the bug
the path option is missing from all createFileRoute functions in the "routing concepts" page of the docs
https://tanstack.com/router/latest/docs/framework/react/routing/routing-concepts
https://github.com/TanStack/router/blob/main/docs/router/framework/react/routing/routing-concepts.md
Your Example Website or App
https://tanstack.com/router/latest/docs/framework/react/routing/routing-concepts
Steps to Reproduce the Bug or Issue
visit https://tanstack.com/router/latest/docs/framework/react/routing/routing-concepts
Expected behavior
export const Route = createFileRoute('/posts/')({ // path option should be present
component: PostsIndexComponent,
})
Screenshots or Videos
Platform
- OS: macOS
- Browser: Chrome, Safari
Additional context
No response
Noticed this too. pretty disappointing honestly
The path is not required:
"Wait, you're making me pass the path of the route file to createFileRoute?"
Yes! But don't worry, this path is automatically written and managed by the router for you via the TanStack Router Bundler Plugin or Router CLI. So, as you create new routes, move routes around or rename routes, the path will be updated for you automatically.
The reason for this pathname has everything to do with the magical type safety of TanStack Router. Without this pathname, TypeScript would have no idea what file we're in! (We wish TypeScript had a built-in for this, but they don't yet 🤷♂️)
Take a look at the comment by @schiller-manuel
Ohh so you need to run the CLI before the typescript lsp server picks up the types?