When working with React-native, I came across a component called FlatList
which includes a property known as ListHeaderComponent
. My question is how to specify the type of this property without having to manually copy and paste the original type.
Currently, my code looks like this:
export function AccountMediaGalleryComponent({
style,
ListHeaderComponent,
ListHeaderComponentStyle,
}: {
style: StyleProp<ViewStyle>;
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null;
ListHeaderComponentStyle?: StyleProp<ViewStyle>;
}): JSX.Element {
I had hoped to do something like:
ListHeaderComponent?: typeof FlatList.ListHeaderComponent
However, this did not compile successfully.