Skip to content

Commit

Permalink
Update index.d.ts (#2827)
Browse files Browse the repository at this point in the history
  • Loading branch information
PlabanJr authored and sankhadeeproy007 committed Jul 31, 2019
1 parent 045cce9 commit fdc2294
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ declare module "native-base" {
* Array of data chunks to render iteratively.
*/
dataArray?: Array<any>;
renderItem?: (
rowData: any,
rowID: string | number,
) => React.ReactElement<any>;
renderRow?: (
rowData: any,
sectionID: string | number,
Expand Down
6 changes: 5 additions & 1 deletion src/basic/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ class List extends Component {
<FlatList
ref={ref => (this._root = ref)}
data={dataArray}
renderItem={({ item, index }) => this.props.renderRow(item, index)}
renderItem={({ item, index }) =>
this.props.renderItem
? this.props.renderItem({ item, index })
: this.props.renderRow(item, 0, index)
}
{...this.props}
/>
);
Expand Down

0 comments on commit fdc2294

Please sign in to comment.