fetcher.load and Link concurrency #11949
Unanswered
simonrelet
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
In my application, when a user clicks on a
<Link preventScrollReset />
, afetcher.load
is called in parallel with theclientLoader
of the child route. The problem is that the page is scrolled to the top despite thepreventScrollReset
.I went to look in the code and I saw that
pendingPreventScrollReset
is global to a router. So a call tofetcher.load
will overwrite the value defined by the current navigation. Is this an intended behavior?useSubmit
andfetcher.submit
accept apreventScrollReset
option but notfetcher.load
. At the moment I don't see any other solution than to forcepreventScrollReset
with a cast, but I don't think it's the right solution.What's the best way to do this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions