claude-start-cf
Back to posts

Dynamic route segments

/posts/2 — src/routes/posts/$postId.tsx

Prefix a filename with $ to create a dynamic segment. $postId.tsx captures that part of the URL and makes it available via Route.useParams(). The value is fully type-safe.

Dynamic route: The postId param was captured from the URL as "2" via Route.useParams().