TanStackT
TanStack2y ago
2 replies
endless-jade

Accessing Path Params For Component in createRoute

Lets say i have a general component that accepts a prop called id, how would I pass that id to my component without having to define route functions inside my component. I'm wondering if something like this is possible:
const Route = createFileRoute('/posts/$postId')({
  component: () => <PostComponent id={id} />
})
Was this page helpful?