diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index aaed6e2c28..5fbf9132d1 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -52,7 +52,6 @@ /// /// -import * as PropTypes from 'prop-types'; import * as React from 'react'; type Constructor = new (...args: any[]) => T; @@ -3883,12 +3882,12 @@ export interface FlatListProps extends VirtualizedListProps { * Remember to include separator length (height or width) in your offset calculation if you specify * `ItemSeparatorComponent`. */ - getItemLayout?: (data: Array | null, index: number) => { length: number; offset: number; index: number }; + getItemLayout?: (data: Array | null | undefined, index: number) => { length: number; offset: number; index: number }; /** * If true, renders items next to each other horizontally instead of stacked vertically. */ - horizontal?: boolean; + horizontal?: boolean | null; /** * How many items to render in the initial batch @@ -3898,7 +3897,7 @@ export interface FlatListProps extends VirtualizedListProps { /** * Instead of starting at the top with the first item, start at initialScrollIndex */ - initialScrollIndex?: number; + initialScrollIndex?: number | null; /** * Used to extract a unique key for a given item at the specified index. Key is used for caching @@ -3960,7 +3959,7 @@ export interface FlatListProps extends VirtualizedListProps { * ``` * Provides additional metadata like `index` if you need it. */ - renderItem: ListRenderItem; + renderItem: ListRenderItem | null | undefined; /** * See `ViewabilityHelper` for flow type and further documentation. @@ -4107,7 +4106,7 @@ export interface SectionListProps extends VirtualizedListWithoutRenderIte /** * Reverses the direction of scroll. Uses scale transforms of -1. */ - inverted?: boolean; + inverted?: boolean | null; /** * Used to extract a unique key for a given item at the specified index. Key is used for caching @@ -4250,7 +4249,7 @@ export interface SectionListStatic extends React.ComponentClass extends VirtualizedListWithoutRenderItemProps { - renderItem: ListRenderItem; + renderItem: ListRenderItem | null | undefined; } export interface VirtualizedListWithoutRenderItemProps extends ScrollViewProps { @@ -4317,7 +4316,7 @@ export interface VirtualizedListWithoutRenderItemProps extends ScrollView index: number; }; - horizontal?: boolean; + horizontal?: boolean | null; /** * How many items to render in the initial batch. This should be enough to fill the screen but not @@ -4332,12 +4331,12 @@ export interface VirtualizedListWithoutRenderItemProps extends ScrollView * always rendered and immediately renders the items starting at this initial index. Requires * `getItemLayout` to be implemented. */ - initialScrollIndex?: number; + initialScrollIndex?: number | null; /** * Reverses the direction of scroll. Uses scale transforms of -1. */ - inverted?: boolean; + inverted?: boolean | null; keyExtractor?: (item: ItemT, index: number) => string; @@ -6199,7 +6198,7 @@ export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollVi * When true the scroll view's children are arranged horizontally in a row * instead of vertically in a column. The default value is false. */ - horizontal?: boolean; + horizontal?: boolean | null; /** * If sticky headers should stick at the bottom instead of the top of the @@ -6584,13 +6583,13 @@ export interface ActionSheetIOSStatic { export type ShareContent = | { - title?: string; - message: string; - } + title?: string; + message: string; +} | { - title?: string; - url: string; - }; + title?: string; + url: string; +}; export type ShareOptions = { dialogTitle?: string;