Skip to content

Conversation

@HirotoShioi
Copy link
Contributor

@HirotoShioi HirotoShioi commented Oct 19, 2025

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

Fix how __root.tsx should be modified so that it loads css files. I had a issue where my css file was not being loaded and this fix resolved it.
@github-actions github-actions bot added the documentation Everything documentation related label Oct 19, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 19, 2025

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 hrefto attribute changes.

Possibly related PRs

  • 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 name Status Explanation Resolution
Title Check ❓ Inconclusive The 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 name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check 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.

@HirotoShioi
Copy link
Contributor Author

@schiller-manuel schiller-manuel changed the title Update migrate-from-next-js.md docs: Update migrate-from-next-js.md Oct 19, 2025
@schiller-manuel schiller-manuel merged commit 36e489c into TanStack:main Oct 19, 2025
2 checks passed
@HirotoShioi HirotoShioi deleted the patch-1 branch October 19, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants