File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,18 @@ export interface FetchProps<TData = any> {
38
38
fetchFunction ?: ( url : string , options : RequestInit ) => Promise < any > ;
39
39
onDataChange ?: ( newData : TData , data : TData ) => any ;
40
40
onChange ?: ( result : FetchResult < TData > ) => void ;
41
- children : ( result : FetchResult < TData > ) => React . ReactNode | React . ReactNode ;
42
41
}
43
42
44
43
export function useFetch < TData = any > (
45
44
props : FetchProps < TData >
46
45
) : FetchResult < TData > ;
47
46
48
47
export default class Fetch < TData = any > extends React . Component <
49
- FetchProps < TData >
48
+ FetchProps < TData > & {
49
+ children ?: (
50
+ result : FetchResult < TData >
51
+ ) => React . ReactNode | React . ReactNode ;
52
+ }
50
53
> {
51
54
// Passing any to FetchResult as unable to use TData
52
55
static Consumer : React . Consumer < FetchResult < any > > ;
You can’t perform that action at this time.
0 commit comments