Skip to content

Conversation

@DeTuksa
Copy link
Contributor

@DeTuksa DeTuksa commented Nov 22, 2025

In docs/router/framework/react/api/router/defaultGlobalNotFoundComponent.md it shows that:

DefaultGlobalNotFound returns

<p>Not Found</p>

Summary by CodeRabbit

  • Documentation

    • Added comprehensive JSDoc documentation for not-found error handling and fallback rendering
  • Style

    • Updated default not-found error display format from div to paragraph element in routing libraries
    • Extended Solid router method signature to accept additional data parameter

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 22, 2025

Walkthrough

The PR updates renderRouteNotFound implementations in React and Solid router packages by adding JSDoc documentation, changing the default not-found element from a div to a paragraph, adding a data parameter to the Solid implementation, and updating corresponding documentation.

Changes

Cohort / File(s) Summary
Router implementations
packages/react-router/src/renderRouteNotFound.tsx, packages/solid-router/src/renderRouteNotFound.tsx
Added JSDoc documentation blocks. Updated development warning message to render <p>Not Found</p> instead of <div>Not Found</div>. Solid router adds new data parameter to function signature.
Documentation
docs/router/framework/react/guide/not-found-errors.md
Updated reference to reflect that default not-found component renders <p>Not Found</p> instead of <div>Not Found</div>.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • The Solid router signature change adding the data parameter requires verification that all call sites have been updated accordingly
  • Confirm the JSDoc documentation accurately reflects the function behavior

Possibly related PRs

Suggested reviewers

  • schiller-manuel
  • brenelz

Poem

🐰 From divs to paragraphs, we now proclaim,
With JSDoc blessing and data to claim,
Not Found feels lighter in <p> attire,
Solid and React both climbing higher! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references issue #5757 and describes fixing the defaultNotFoundComponent, which directly relates to the main changes of updating the default not-found UI from
to

elements across react-router and solid-router packages.

Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df3c1a4 and f65d3e9.

📒 Files selected for processing (1)
  • docs/router/framework/react/guide/not-found-errors.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
🔇 Additional comments (1)
docs/router/framework/react/guide/not-found-errors.md (1)

167-167: Documentation correctly updated to reflect default not-found component behavior.

Line 167 now accurately documents that the default fallback renders <p>Not Found</p>, aligning with the updated implementation. This change ensures consistency between the documented behavior and the actual default component.


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.

@nx-cloud
Copy link

nx-cloud bot commented Nov 22, 2025

View your CI Pipeline Execution ↗ for commit f65d3e9

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 7m 3s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-22 14:18:52 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 22, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5937

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5937

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5937

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5937

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5937

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5937

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5937

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5937

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5937

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5937

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5937

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5937

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5937

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5937

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5937

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5937

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5937

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5937

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5937

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5937

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5937

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5937

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5937

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5937

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5937

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5937

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5937

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5937

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5937

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5937

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5937

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5937

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5937

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5937

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5937

commit: f65d3e9

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/solid-router/src/renderRouteNotFound.tsx (1)

16-16: All call sites properly updated for the new data parameter.

The breaking change has been successfully addressed. Both solid-router and react-router implementations have all call sites updated to pass the new parameter—either with error data or undefined.

Consider replacing data: any with a more specific type (e.g., Record<string, unknown>) for improved type safety.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02e38f0 and df3c1a4.

📒 Files selected for processing (2)
  • packages/react-router/src/renderRouteNotFound.tsx (2 hunks)
  • packages/solid-router/src/renderRouteNotFound.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react-router/src/renderRouteNotFound.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • packages/solid-router/src/renderRouteNotFound.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test
  • GitHub Check: Preview
🔇 Additional comments (2)
packages/solid-router/src/renderRouteNotFound.tsx (2)

5-12: LGTM: Good documentation addition.

The JSDoc comment properly documents the function's purpose, parameters, and return value, improving code maintainability.


26-26: LGTM: Fixes malformed HTML and aligns with documentation.

The warning message now correctly uses <p>Not Found</p> instead of the malformed <div>Not Found<div>, fixing both the HTML syntax error and aligning with the documented default component output.

@schiller-manuel schiller-manuel changed the title fix: Fixed the defaultNotFoundComponent as guided by #5757 chore Fixed the defaultNotFoundComponent as guided by #5757 Nov 22, 2025
@schiller-manuel schiller-manuel changed the title chore Fixed the defaultNotFoundComponent as guided by #5757 chore: Fixed the defaultNotFoundComponent as guided by #5757 Nov 22, 2025
@@ -1,17 +1,20 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: b11df627d8b3c51b1bf3230a546b0f20)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated file, please dont change it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got you! It was actually done by the autofix-ci[bot]. Would look to revert it now on my end

@birkskyum
Copy link
Member

birkskyum commented Nov 22, 2025

Thanks! I think there's a mention in the not-found-errors.md too that <div> is default, which is false.

@DeTuksa
Copy link
Contributor Author

DeTuksa commented Nov 22, 2025

Thanks! I think there's a mention in the not-found-errors.md too that <div> is default, which is false.

Gotcha! I'll update it now to <p>

Do you think I should also correct the other places where notFoundComponent has been written as <div>Not Found</div> to <p>Not Found</p>

@birkskyum
Copy link
Member

@DeTuksa i think the remaining places are overrides - they can be left, it's allowed to do custom not found components.

@github-actions github-actions bot added the documentation Everything documentation related label Nov 22, 2025
@birkskyum birkskyum merged commit 3a14ffc into TanStack:main Nov 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants