From c6fe101cdcc0b8d640a86108d8a76f7292b5f799 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Wed, 29 Nov 2017 10:47:47 -0800 Subject: [PATCH] export SeparatorsObj type for re-use in ListItems etc. Differential Revision: D6354300 fbshipit-source-id: 3fd4c86ef1d190fb544f2c6fccb638ffe3ced378 --- Libraries/Lists/FlatList.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js index 63539c89c..0f21d8520 100644 --- a/Libraries/Lists/FlatList.js +++ b/Libraries/Lists/FlatList.js @@ -28,6 +28,12 @@ import type { } from 'ViewabilityHelper'; import type {Props as VirtualizedListProps} from 'VirtualizedList'; +export type SeparatorsObj = { + highlight: () => void, + unhighlight: () => void, + updateProps: (select: 'leading' | 'trailing', newProps: Object) => void, +}; + type RequiredProps = { /** * Takes an item from `data` and renders it into the list. Example usage: @@ -58,11 +64,7 @@ type RequiredProps = { renderItem: (info: { item: ItemT, index: number, - separators: { - highlight: () => void, - unhighlight: () => void, - updateProps: (select: 'leading' | 'trailing', newProps: Object) => void, - }, + separators: SeparatorsObj, }) => ?React.Element, /** * For simplicity, data is just a plain array. If you want to use something else, like an