How to handle 405 errors with useDebounceFetcher #302
Unanswered
zwhitchcox
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I think adding the path yourself is not an issue but it would be idea to don't need it. @jacobparis what do you think? I think the hook could call useLocation to know the current pathname and automatically add it if a custom one is not provided. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
When you navigate away from a page, and a debounced action is still submitting, it will be submitted to the page you just navigated to.
In my code:
if someone navigates away from the page before the 500 ms have elapsed and the action has been submitted, it will submit to the new page.
I have circumvented this problem by adding the pathname as the action:
However, this is not ideal, as it requires me to remember to add the pathname to every debounced fetcher.
I was wondering if anyone had a solution to this, or maybe the pathname should be saved in a closure when the submit method is called.
I can open an issue for this if that would be useful.
Beta Was this translation helpful? Give feedback.
All reactions