router
router copied to clipboard
ErrorElement not rendered
Describe the bug
I am not sure the errorElement is working as it should, or whether I am misunderstanding it.
See this fork of the basic example: https://codesandbox.io/s/stupefied-mountain-6shsph?file=/src/index.tsx
I would expect the <h1>error</h1>
to be rendered for the root page, yet I see the normal element. Is this a bug?
Cheers
Your Example Website or App
https://codesandbox.io/s/stupefied-mountain-6shsph?file=/src/index.tsx
Steps to Reproduce the Bug or Issue
- Click on home
- See "Welcome Home!"
Expected behavior
- Click on home
- See
<div><h1>error</h1></div>
Screenshots or Videos
No response
Platform
- OS: macOS 12.3
- Browser: Safari 15.4
- Version: 3.7.4
Additional context
No response
https://github.com/TanStack/react-location/discussions/249 I see this issue was reported here too. However, I went all the way back to the latest stable version (3.5.2 I believe?) and even there the issue occurred.
Known issue. Working on it.
Tanner Linsley On Apr 2, 2022, 9:48 AM -0700, Diederik van den Burger @.***>, wrote:
#249 I see this issue was reported here too. However, I went all the way back to the latest stable version (3.5.2 I believe?) and even there the issue occurred. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Anything I can do to help? I wouldn't mind diving in to the code and submit a PR, if you're not too close to fixing it yourself already.
Does anyone have a workaround for this issue?
@robcaldecott not sure if this is the way to go for this problem, but for me it seems to resolve the issue.
https://github.com/DiederikvandenB/react-location/commit/4b7d9c943811836c449d650c2d4c5b708d58aca4
Hi @tannerlinsley, could you provide an update on this bug's status? If you can't deal with this right now, that's perfectly fine of course, but if support for this package is not on your roadmap, we'd love to hear that now before fully committing to using it.
@DiederikvandenB same here. I'm hesitating between react-router
or react-location
, some features of react-location
are appealing but it feels unfinished.
I am working on a fix for this, but don't have an ETA yet. I'm pretty heads down in React Table this week. Re: @DiederikvandenB, I would say unless you're in dire need of the better search param APIs of react-location, you'd be better off waiting for the next react-router version with all of the async loader features.
Alright, thanks for your response Tanner!
Is there any update on this?
@robcaldecott not sure if this is the way to go for this problem, but for me it seems to resolve the issue.
If you're still using this workaround, has it continued working for you? I'm thinking of just doing the same thing you did but I'm not sure if it'll break anything else.
@tom-ricci, it seems to be running stable, but only in our develop environment. UAT starts this week.
We are however still considering switching back to react-router once their merge with Remix' router is finished. See: https://github.com/remix-run/react-router/pull/8855 and https://github.com/remix-run/react-router/tree/remixing
I've submitted a PR to fix this: https://github.com/TanStack/react-location/pull/290
This