Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultErrorComponent default does not behave as expected #2336

Open
nstepien opened this issue Sep 14, 2024 · 0 comments
Open

defaultErrorComponent default does not behave as expected #2336

nstepien opened this issue Sep 14, 2024 · 0 comments

Comments

@nstepien
Copy link

Which project does this relate to?

Router

Describe the bug

According to the docs/jsdoc, defaultErrorComponent defaults to ErrorComponent, but it doesn't behave as if ErrorComponent is set.

const router = createRouter({
  routeTree,
  defaultErrorComponent: ErrorComponent
});

Your Example Website or App

https://stackblitz.com/edit/github-svg4st?file=src%2Fmain.tsx,src%2Froutes%2Findex.tsx

Steps to Reproduce the Bug or Issue

  1. Click on the Crash the page button
  2. Notice that the outlet renders the error component
  3. Comment out the defaultErrorComponent line in main.tsx
  4. Crash the page again
  5. Notice that the whole page is now replaced with the error component, the navigation links are gone

Expected behavior

defaultErrorComponent should behave as documented, i.e. it should behave as if ErrorComponent is set.
In comparison, defaultNotFoundComponent works as expected in either case. 👍

Screenshots or Videos

Image
Image

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: 1.57.13

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant