Deterministic way to gate navigation on preload success? #7002
Unanswered
Nandan1996
asked this question in
Q&A
Replies: 1 comment 3 replies
-
|
Hey @tannerlinsley @schiller-manuel , |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks, we are working through a checkout-style flow and wanted to check if there is an intended pattern for this.
Our goal is:
We found that the immediate enter refetch is handled by setting a staleTime, so that part is OK.
What we are still missing is a deterministic success or failure signal from preloadRoute() itself.
staleReloadMode: blocking helps because preload waits for the loader promise to settle, but if the loader throws, preloadRoute() seems to return undefined, and we could not find a clean API to know whether route B loader actually succeeded or failed before deciding to navigate.
Is there a first-class TanStack Router way to gate navigation on preload success, without directly calling route B fetcher outside the loader?
Beta Was this translation helpful? Give feedback.
All reactions