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 = { className: "style", ListFooterComponentClassName: "ListFooterComponentStyle", ListHeaderComponentClassName: "ListHeaderComponentStyle", columnWrapperClassName: "columnWrapperStyle", contentContainerClassName: "contentContainerStyle", }; export const FlatList = copyComponentProperties(RNFlatList, function < ItemT, >(props: StyledProps, typeof mapping>) { return useCssElement(RNFlatList, props, mapping); }) as unknown as typeof RNFlatList & (( props: StyledProps< FlatListProps, StyledConfiguration >, ) => ReactNode); export default FlatList;