Skip to content

Commit c6fe101

Browse files
sahrensfacebook-github-bot
authored andcommitted
export SeparatorsObj type for re-use in ListItems etc.
Differential Revision: D6354300 fbshipit-source-id: 3fd4c86ef1d190fb544f2c6fccb638ffe3ced378
1 parent 21714fe commit c6fe101

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Libraries/Lists/FlatList.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ import type {
2828
} from 'ViewabilityHelper';
2929
import type {Props as VirtualizedListProps} from 'VirtualizedList';
3030

31+
export type SeparatorsObj = {
32+
highlight: () => void,
33+
unhighlight: () => void,
34+
updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,
35+
};
36+
3137
type RequiredProps<ItemT> = {
3238
/**
3339
* Takes an item from `data` and renders it into the list. Example usage:
@@ -58,11 +64,7 @@ type RequiredProps<ItemT> = {
5864
renderItem: (info: {
5965
item: ItemT,
6066
index: number,
61-
separators: {
62-
highlight: () => void,
63-
unhighlight: () => void,
64-
updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,
65-
},
67+
separators: SeparatorsObj,
6668
}) => ?React.Element<any>,
6769
/**
6870
* For simplicity, data is just a plain array. If you want to use something else, like an

0 commit comments

Comments
 (0)