Redirects cause root route loader invocation but root route component does not receive loader data
See original GitHub issueWhat version of Remix are you using?
1.5.1
Steps to Reproduce
A repo with a minimal reproduction is available here: https://github.com/jangerhofer/remixRootRouteRedirectReproduction along with some directions.
Expected Behavior
I expect that a server-side redirect (whether performance only once or multiple times) would cause a fresh root route loader
function invocation and that the (serialized) value returned from the loader
would be made available to the root route component via the useLoaderData
hook.
Actual Behavior
Instead, I see only the invocation the root route loader
; the useLoaderData
hook’s value remains an empty object despite the loader
returning data.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
reactjs - Does history.push supposed to render the component ...
Show activity on this post. So I'm creating a loader component that requests data to a server, then based on the response -...
Read more >Angular Navigation: How Routing & Redirects Work in Angular ...
Lazy loading routes. Now the current way our routes are setup makes it so they are included in the same chunk as the...
Read more >Loading data • Docs • SvelteKit
Universal load functions are useful when you need to fetch data from an external API and don't need private credentials, since SvelteKit can...
Read more >Class: CoreRouter - Oracle
The root router instance is the top-most router, and it has no parent. ... Create a CoreRouter with a named route and a...
Read more >Backbone.js
More Than One Way To Do It; – Nested Models & Collections; – Loading ... Events do not have to be declared before...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Definitely sounds like multi-redirect is the problem here. I’m pretty sure our new code over in React Router doesn’t do this. @brophdawg11 you mind looking into this one, fixing in Remix and verifying we have a test for it in React Router?
Should be able to make a test case out of the repo² pretty easily (get it? reproduction repository, the repo squared?! … yeah it’s early).
Closed by #3460