From a8391bde7d757d01521a6d12170fb9090c17a6a0 Mon Sep 17 00:00:00 2001 From: Matt Sessions Date: Fri, 29 Dec 2017 14:04:34 -0800 Subject: [PATCH] SectionList renderItem should be optional Summary: `renderItem` on `SectionList` is within the `OptionalProps` group of props but it is not actually marked as optional. Which means that doing things such as in the example where each section has its own `renderItem` and no `renderItem` prop is passed into `SectionList` will fail flow. Create a `SectionList` where each section has it's own `renderItem` and do not pass in a `renderItem` into `SectionList`. Run flow, it should error. [GENERAL] [MINOR] [SectionList] -Makes `renderItem` prop on `SectionList` optional for flow. Closes https://github.com/facebook/react-native/pull/17262 Differential Revision: D6645672 Pulled By: hramos fbshipit-source-id: 1096e8c4998c14003cf42f29ea559505082047c1 --- Libraries/Lists/SectionList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Lists/SectionList.js b/Libraries/Lists/SectionList.js index 775685131d6eaa..f547066f129b72 100644 --- a/Libraries/Lists/SectionList.js +++ b/Libraries/Lists/SectionList.js @@ -71,7 +71,7 @@ type OptionalProps> = { /** * Default renderer for every item in every section. Can be over-ridden on a per-section basis. */ - renderItem: (info: { + renderItem?: (info: { item: Item, index: number, section: SectionT,