You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing a situation where when I am trying to redirect (return redirect()) from a clientLoader of a child route (e.g. /posts/1/history) to the parent route (e.g. /posts/1), the parent route component throws with loaderData is null. The redirect happens and the url is correct in the address bar.
This only happens on page requests, i.e. going directly to /posts/1/history. Client navigation works as expected and redirects without errors. When trying to redirect for example from the clientLoader of / to /posts/1/history on page load, then that works fine as well. My guess is that it might have something to do with single fetch.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am experiencing a situation where when I am trying to redirect (
return redirect()
) from aclientLoader
of a child route (e.g./posts/1/history
) to the parent route (e.g./posts/1
), the parent route component throws withloaderData is null
. The redirect happens and the url is correct in the address bar.This only happens on page requests, i.e. going directly to
/posts/1/history
. Client navigation works as expected and redirects without errors. When trying to redirect for example from theclientLoader
of/
to/posts/1/history
on page load, then that works fine as well. My guess is that it might have something to do with single fetch.I am using
ssr: false
(SPA mode)See example here: https://stackblitz.com/edit/github-vapjjyhs-ajkpbdjs
Beta Was this translation helpful? Give feedback.
All reactions