Skip to content
Source
Sign inSign up
TanStack/router

docs: Update migrate-from-next-js.md #5533

MergedHirotoShioi(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5533/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Fix how __root.tsx should be modified when migrating from Nextjs so that it loads css files.

I had a issue when I've tried to migrate from Nextjs to Tanstack Start where my css file was not being loaded which caused my app to briefly show un-styled content. This modification fixed it so I thought it would be cool to share it with other people who will most likely face this issue when migration from nextjs

    1. Walkthrough

      This PR updates the Next.js migration guide documentation to demonstrate TanStack Router's file-based routing API. It replaces default page exports with createFileRoute Route declarations, updates data fetching to use loader functions, changes parameter access to Route.useParams(), and updates Link component imports and usage patterns.

      Changes

      Cohort / File(s)Summary
      Next.js to TanStack Router Migration Examples
      docs/start/framework/react/migrate-from-next-js.md
      Replaced default page component exports with createFileRoute Route declarations. Updated data fetching patterns to use loader functions. Changed dynamic parameter access from function props to Route.useParams() hook. Updated Link component imports from next/link to @tanstack/react-router with corresponding href → to attribute changes.
      • TanStack/router#5326: Implements the same documentation-level migration changes replacing default-exported page components with createFileRoute Route declarations and updating hook/import patterns.

      Suggested reviewers

      • Insik-Han

      Poem

      🐰 From Next.js paths to routes so bright, Our docs now guide with patterns just right, Loaders leap and hooks take flight, The migration path shines pure and white! TanStack Router—a rabbit's delight! ✨

      Pre-merge checks and finishing touches

      ❌ Failed checks (1 inconclusive)
      Check nameStatusExplanationResolution
      Title Check❓ InconclusiveThe PR title "docs: Update migrate-from-next-js.md" is vague and generic, using the non-descriptive term "Update" without specifying what substantive changes were made. While the title correctly identifies the file being modified, it fails to convey the meaningful nature of the changes, which according to the raw summary include updates to Route declarations, data fetching patterns, dynamic route handling, and component imports. The title provides no insight into the primary purpose of these documentation updates.Consider revising the title to be more specific about the changes, such as "docs: Update Next.js migration guide with TanStack Router patterns" or "docs: Add createFileRoute and loader examples to migration guide," which would clearly communicate the primary nature of the updates to reviewers scanning the commit history.
      ✅ Passed checks (2 passed)
      Check nameStatusExplanation
      Docstring Coverage✅ PassedNo functions found in the changes. Docstring coverage check skipped.
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      ✨ Finishing touches
      • 📝 Generate docstrings
        🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.

Sign in to join this conversation.