@@ -60,11 +60,7 @@ export default function useFetch<
60
60
61
61
// Compute denormalized value
62
62
const { expiryStatus, expiresAt } = useMemo ( ( ) => {
63
- return controller . getResponse ( endpoint , ...args , state ) as {
64
- data : Denormalize < E [ 'schema' ] > ;
65
- expiryStatus : ExpiryStatus ;
66
- expiresAt : number ;
67
- } ;
63
+ return controller . getResponse ( endpoint , ...args , state ) ;
68
64
// eslint-disable-next-line react-hooks/exhaustive-deps
69
65
} , [
70
66
cacheResults ,
@@ -82,7 +78,7 @@ export default function useFetch<
82
78
// null params mean don't do anything
83
79
if ( ( Date . now ( ) <= expiresAt && ! forceFetch ) || ! key ) return ;
84
80
// if args is [null], we won't get to this line
85
- return controller . fetch ( endpoint , ...( args as [ ... Parameters < E > ] ) ) ;
81
+ return controller . fetch ( endpoint , ...( args as Parameters < E > ) ) ;
86
82
// we need to check against serialized params, since params can change frequently
87
83
// eslint-disable-next-line react-hooks/exhaustive-deps
88
84
} , [ expiresAt , controller , key , forceFetch , state . lastReset ] ) ;
@@ -91,7 +87,7 @@ export default function useFetch<
91
87
// revalidating non-suspending data is low priority, so make sure it doesn't stutter animations
92
88
const task = InteractionManager . runAfterInteractions ( ( ) => {
93
89
if ( Date . now ( ) > expiresAt && key ) {
94
- controller . fetch ( endpoint , ...( args as readonly [ ... Parameters < E > ] ) ) ;
90
+ controller . fetch ( endpoint , ...( args as Parameters < E > ) ) ;
95
91
}
96
92
} ) ;
97
93
0 commit comments