Skip to content

Commit

Permalink
export SeparatorsObj type for re-use in ListItems etc.
Browse files Browse the repository at this point in the history
Differential Revision: D6354300

fbshipit-source-id: 3fd4c86ef1d190fb544f2c6fccb638ffe3ced378
  • Loading branch information
sahrens authored and facebook-github-bot committed Nov 29, 2017
1 parent 21714fe commit c6fe101
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Libraries/Lists/FlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<ItemT> = {
/**
* Takes an item from `data` and renders it into the list. Example usage:
Expand Down Expand Up @@ -58,11 +64,7 @@ type RequiredProps<ItemT> = {
renderItem: (info: {
item: ItemT,
index: number,
separators: {
highlight: () => void,
unhighlight: () => void,
updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,
},
separators: SeparatorsObj,
}) => ?React.Element<any>,
/**
* For simplicity, data is just a plain array. If you want to use something else, like an
Expand Down

0 comments on commit c6fe101

Please sign in to comment.