From fc91b889a295eb5353f70800a1c3a113e8b8aa91 Mon Sep 17 00:00:00 2001 From: Kacper Wiszczuk Date: Mon, 8 Oct 2018 20:48:54 +0200 Subject: [PATCH] FIX Update FlatList and SectionList props (#29543) --- types/react-native/index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index e18695e55d..781179a452 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3846,22 +3846,22 @@ export interface FlatListProps extends VirtualizedListProps { /** * Rendered in between each item, but not at the top or bottom */ - ItemSeparatorComponent?: React.ComponentType | (() => React.ReactElement) | null; + ItemSeparatorComponent?: React.ComponentType; /** * Rendered when the list is empty. */ - ListEmptyComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListEmptyComponent?: React.ComponentType | React.ReactElement; /** * Rendered at the very end of the list. */ - ListFooterComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListFooterComponent?: React.ComponentType | React.ReactElement; /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListHeaderComponent?: React.ComponentType | React.ReactElement; /** * Optional custom style for multi-item rows generated when numColumns > 1 @@ -4042,7 +4042,7 @@ export interface SectionBase { renderItem?: SectionListRenderItem; - ItemSeparatorComponent?: React.ComponentClass | (() => React.ReactElement) | null; + ItemSeparatorComponent?: React.ComponentType; keyExtractor?: (item: ItemT, index: number) => string; } @@ -4065,27 +4065,27 @@ export interface SectionListProps extends VirtualizedListWithoutRenderIte /** * Rendered in between adjacent Items within each section. */ - ItemSeparatorComponent?: React.ComponentType | null; + ItemSeparatorComponent?: React.ComponentType; /** * Rendered when the list is empty. */ - ListEmptyComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListEmptyComponent?: React.ComponentType | React.ReactElement; /** * Rendered at the very end of the list. */ - ListFooterComponent?: React.ComponentClass | (() => React.ReactElement) | null; + ListFooterComponent?: React.ComponentType | React.ReactElement; /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListHeaderComponent?: React.ComponentType | React.ReactElement; /** * Rendered in between each section. */ - SectionSeparatorComponent?: React.ComponentClass | (() => React.ReactElement) | null; + SectionSeparatorComponent?: React.ComponentType | React.ReactElement; /** * A marker property for telling the list to re-render (since it implements PureComponent). @@ -4229,19 +4229,19 @@ export interface SectionListStatic extends React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListEmptyComponent?: React.ComponentType | React.ReactElement; /** * Rendered at the bottom of all the items. Can be a React Component Class, a render function, or * a rendered element. */ - ListFooterComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListFooterComponent?: React.ComponentType | React.ReactElement; /** * Rendered at the top of all the items. Can be a React Component Class, a render function, or * a rendered element. */ - ListHeaderComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; + ListHeaderComponent?: React.ComponentType | React.ReactElement; /** * The default accessor functions assume this is an Array<{key: string}> but you can override