diff --git a/Libraries/Lists/SectionList.js b/Libraries/Lists/SectionList.js index 442779e52de..8dbcfcadc1c 100644 --- a/Libraries/Lists/SectionList.js +++ b/Libraries/Lists/SectionList.js @@ -53,7 +53,7 @@ type OptionalProps> = { unhighlight: () => void, updateProps: (select: 'leading' | 'trailing', newProps: Object) => void, }, - }) => ?React.Element, + }) => null | React.Element, /** * Rendered in between each item, but not at the top or bottom. By default, `highlighted`, * `section`, and `[leading/trailing][Item/Separator]` props are provided. `renderItem` provides @@ -146,11 +146,15 @@ type OptionalProps> = { * Rendered at the top of each section. These stick to the top of the `ScrollView` by default on * iOS. See `stickySectionHeadersEnabled`. */ - renderSectionHeader?: ?(info: {section: SectionT}) => ?React.Element, + renderSectionHeader?: ?(info: { + section: SectionT, + }) => null | React.Element, /** * Rendered at the bottom of each section. */ - renderSectionFooter?: ?(info: {section: SectionT}) => ?React.Element, + renderSectionFooter?: ?(info: { + section: SectionT, + }) => null | React.Element, /** * Makes section headers stick to the top of the screen until the next one pushes it off. Only * enabled by default on iOS because that is the platform standard there. diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index 59cf10c091f..59e6185c3de 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -41,7 +41,7 @@ export type SectionBase = { unhighlight: () => void, updateProps: (select: 'leading' | 'trailing', newProps: Object) => void, }, - }) => ?React.Element, + }) => null | React.Element, ItemSeparatorComponent?: ?React.ComponentType, keyExtractor?: (item: SectionItemT, index?: ?number) => string, }; @@ -71,15 +71,15 @@ type OptionalProps> = { unhighlight: () => void, updateProps: (select: 'leading' | 'trailing', newProps: Object) => void, }, - }) => ?React.Element, + }) => null | React.Element, /** * Rendered at the top of each section. */ - renderSectionHeader?: ?({section: SectionT}) => ?React.Element, + renderSectionHeader?: ?({section: SectionT}) => null | React.Element, /** * Rendered at the bottom of each section. */ - renderSectionFooter?: ?({section: SectionT}) => ?React.Element, + renderSectionFooter?: ?({section: SectionT}) => null | React.Element, /** * Rendered at the bottom of every Section, except the very last one, in place of the normal * ItemSeparatorComponent.