You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! For better typesafety we should give a loader/action function type parameter to the generic of useFetcher. But we sometimes don't do it, because of laziness or the action is too simple to bother, or nothing is done with the data. In these cases useFetcher (without generics arg) was just behaving normally, silently casting the "data": any.
Actual Behavior
With SingleFetch the definition of useFetcher changed and it seems that we don't have default type parameter anymore:
Having the same problem starting a migration to use singleFetch with 2.9.2. If I change from useFetcher() to useFetcher<unknown>() it seems to work fine.
Reproduction
https://stackblitz.com/edit/remix-run-remix-k6ghpy?file=app%2Froutes%2F_index.tsx
System Info
Used Package Manager
npm
Expected Behavior
Hi! For better typesafety we should give a loader/action function type parameter to the generic of
useFetcher
. But we sometimes don't do it, because of laziness or the action is too simple to bother, or nothing is done with the data. In these casesuseFetcher
(without generics arg) was just behaving normally, silently casting the"data": any
.Actual Behavior
With SingleFetch the definition of
useFetcher
changed and it seems that we don't have default type parameter anymore:Would it be possible to have the
= any
default parameter back?The text was updated successfully, but these errors were encountered: