Skip to content

Documentation Getting Started Flow - auto file gen can get users stuck #5351

Open

Description

@paradoxloop

Which project does this relate to?

Router

Describe the bug

New user follows the getting started flow "build from scratch" can get stuck with with dynamic paths "not working" because the posts.tsx which is meant to be a layout route in the example is auto filled with a page code.

There is nothing wrong with the code here it can just lead to a poor first experience of the framework.

Auto Filled posts.tsx

import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/posts')({
    component: RouteComponent,
})

function RouteComponent() {
    return <div>Hello "/posts"!</div>
}

Potential solutions:

  • Improve the documentation to clearly explain that users need to adjust the generated posts.tsx with an for dynamic routes to work; or
  • Alternatively, change the auto-generated content for layout routes so it better reflects their intended use in the tutorial flow.

This would help prevent misunderstandings for first-time users.

Your Example Website or App

NA

Steps to Reproduce the Bug or Issue

How to reproduce:

  1. Following getting started guide
  2. Under Routing / Creating File Routes create the files in the order they are listed
    posts.tsx -> posts/index.tsx -> posts/$postId.tsx
  3. Check whether the dev server has auto filled the files with RouteComponents
  4. Navigate to localhost:3000/posts/10

Expected behavior

When dev app is running the dynamic url (posts/$postId.tsx) does not appear to be working because the posts.tsx captures all requests rather than being a layout route.

This is not a great experience for someone first exposure to the Tanstack framework.

Screenshots or Videos

Image

Platform

NA

Additional context

No response

Activity

  1. added a commit that references this issue on Jul 18, 2026
    b9d1777
  2. Jyatin commented on Sep 22, 2026

    @Jyatin

    'd like to work on this issue. I plan to update the React routing documentation to clarify the behavior of generated parent/layout routes and explain when is required for nested and dynamic routes. I'll also add a small example showing the expected posts.tsx, posts/index.tsx, and posts/$postId.tsx structure.

  3. Jyatin commented on Sep 22, 2026

    @Jyatin

    I'd like to work on this issue. I plan to update the React routing documentation to clarify the behavior of generated parent/layout routes and explain when <Outlet /> is required for nested and dynamic routes. I'll also add a small example showing the expected posts.tsx, posts/index.tsx, and posts/$postId.tsx structure.

  4. xyonx-bot commented on Nov 9, 2026

    @xyonx-bot

    Opened a PR for this: #8910 — #8910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issue

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions