Remix Utils - v9.0.0
    Preparing search index...

    Function getFetcherType

    • Derive the deprecated fetcher.type from the current state of a fetcher and navigation.

      Parameters

      • fetcher: Pick<FetcherWithComponents<unknown>, "state" | "data" | "formMethod">

        The fetcher object returned form useFetcher

      • navigation: Pick<Navigation, "formMethod" | "state">

        The Navigation object returned from useNavigation

      Returns FetcherType

      let fetcher = useFetcher();
      let navigation = useNavigation();
      let fetcherType = getFetcherType(fetcher, navigation);
      useEffect(() => {
      if (fetcherType === "done") // do something once fetcher is done
      }, [fetcherType])