If a fetcher submitting to an action handler that returns null then getFetcherType returns idle after submission instead of done.
This happens because the initial fetcher.data value is undefined, but in the code if (fetcher.state === "idle" && fetcher.data != null) return "done", fetcher.data is being checked for null
Describe the bug
If a fetcher submitting to an
action
handler that returnsnull
thengetFetcherType
returnsidle
after submission instead ofdone
. This happens because the initialfetcher.data
value isundefined
, but in the code if (fetcher.state === "idle" && fetcher.data != null) return "done",fetcher.data
is being checked fornull
Your Example Website or App
https://stackblitz.com/edit/remix-run-remix-hpas2u?file=app%2Froutes%2F_index.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
If fetcher is triggering
action
which returningnull
value,getFetcherType
should bedone
, notidle
Screenshots or Videos
No response
Platform
Additional context
No response