useFetchers doesn't fire with idle state #8758
Replies: 1 comment
-
Yes, the
If you're interested in one of the fetcher's state, give it a key when you use it, like below // somewhere in the app
const fetcher = useFetcher({ key: "THE_INTERESTING_FETCHER" }) Then anywhere in your app you want to check that fetcher, you can call useFetcher with same key, and you get the same result // somewhere else in the app
const sameFetcher = useFetcher({ key: "THE_INTERESTING_FETCHER" }) But note that if the component that calls |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to know when one of my fetcher (from
useFetchers
) has finished submitting.In other word I want to know when my fetcher is "done".
For that I just have to check if the fetcher state go from "idle" to "loading|submitting" to "idle".
However when I use
useFetchers
(with an S) there are no "idle" state..There is only "submtting" and "loading" state.
In the documentation it says it returns all the "in-flight" fetchers, does it means that it's not returning "idle" state ?
If so, how can I get done state from a fetcher using useFetchers ??
Beta Was this translation helpful? Give feedback.
All reactions