-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathFlatList.tsx
More file actions
32 lines (27 loc) · 986 Bytes
/
FlatList.tsx
File metadata and controls
32 lines (27 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import type { ReactNode } from "react";
import { FlatList as RNFlatList, type FlatListProps } from "react-native";
import {
useCssElement,
type StyledConfiguration,
type StyledProps,
} from "react-native-css";
import { copyComponentProperties } from "./copyComponentProperties";
const mapping: StyledConfiguration<typeof RNFlatList> = {
className: "style",
ListFooterComponentClassName: "ListFooterComponentStyle",
ListHeaderComponentClassName: "ListHeaderComponentStyle",
columnWrapperClassName: "columnWrapperStyle",
contentContainerClassName: "contentContainerStyle",
};
export const FlatList = copyComponentProperties(RNFlatList, function <
ItemT,
>(props: StyledProps<FlatListProps<ItemT>, typeof mapping>) {
return useCssElement(RNFlatList, props, mapping);
}) as unknown as typeof RNFlatList &
(<ItemT>(
props: StyledProps<
FlatListProps<ItemT>,
StyledConfiguration<typeof RNFlatList>
>,
) => ReactNode);
export default FlatList;