question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redirects cause root route loader invocation but root route component does not receive loader data

See original GitHub issue

What 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
ryanflorencecommented, Jun 12, 2022

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).

1reaction
MichaelDeBoeycommented, Jun 21, 2022

Closed by #3460

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found