Skip to content

Commit

Permalink
Remove ListView (#2772)
Browse files Browse the repository at this point in the history
  • Loading branch information
PlabanJr authored and sankhadeeproy007 committed Jul 17, 2019
1 parent ba31eb7 commit 15d7dde
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/basic/Card.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { View, ListView, ViewPropTypes } from 'react-native';
import { FlatList, View, ViewPropTypes } from 'react-native';
import { connectStyle } from 'native-base-shoutem-theme';

import mapPropsToStyleNames from '../utils/mapPropsToStyleNames';

class Card extends Component {
render() {
if (this.props.dataArray && this.props.renderRow) {
const ds = new ListView.DataSource({
rowHasChanged: (r1, r2) => r1 !== r2
});
const dataSource = ds.cloneWithRows(this.props.dataArray);
return (
<ListView
<FlatList
{...this.props}
enableEmptySections
dataSource={dataSource}
renderRow={this.props.renderRow}
data={this.props.dataArray}
renderItem={this.props.renderRow}
keyExtractor={(item, index) => index.toString()}
/>
);
}
Expand Down

0 comments on commit 15d7dde

Please sign in to comment.