Fix types

This commit is contained in:
Zoe Roux 2023-12-12 22:42:50 +01:00
parent 3d53693e68
commit 91498f45cd
2 changed files with 5 additions and 14 deletions

View File

@ -21,16 +21,7 @@
import { Page, QueryIdentifier, useInfiniteFetch } from "@kyoo/models";
import { useBreakpointMap, HR } from "@kyoo/primitives";
import { ContentStyle, FlashList } from "@shopify/flash-list";
import {
ComponentProps,
ComponentType,
isValidElement,
ReactElement,
useCallback,
useReducer,
useRef,
useState,
} from "react";
import { ComponentProps, ComponentType, isValidElement, ReactElement, useRef } from "react";
import { EmptyView, ErrorView, Layout, WithLoading, addHeader } from "./fetch";
import { FlatList, View, ViewStyle } from "react-native";
@ -61,7 +52,7 @@ const emulateGap = (
};
};
export const InfiniteFetchList = <Data, Props, _, Kind>({
export const InfiniteFetchList = <Data, Props, _, Kind extends number | string>({
query,
placeholderCount = 2,
incremental = false,
@ -157,7 +148,7 @@ export const InfiniteFetchList = <Data, Props, _, Kind>({
);
};
export const InfiniteFetch = <Data, Props, _, Kind>({
export const InfiniteFetch = <Data, Props, _, Kind extends number | string>({
query,
...props
}: {

View File

@ -139,7 +139,7 @@ const InfiniteScroll = <Props,>({
);
};
export const InfiniteFetchList = <Data, _, HeaderProps, Kind>({
export const InfiniteFetchList = <Data, _, HeaderProps, Kind extends number | string>({
query,
incremental = false,
placeholderCount = 2,
@ -207,7 +207,7 @@ export const InfiniteFetchList = <Data, _, HeaderProps, Kind>({
);
};
export const InfiniteFetch = <Data, Props, _, Kind>({
export const InfiniteFetch = <Data, Props, _, Kind extends number | string>({
query,
...props
}: {