forked from vergnet/application-amicale
Removed useless PureFlatList.js as FlatList is already a pure component
This commit is contained in:
parent
ba893495e1
commit
ab554cae94
1 changed files with 0 additions and 33 deletions
|
@ -1,33 +0,0 @@
|
||||||
import * as React from 'react';
|
|
||||||
import {FlatList} from "react-native";
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
data: Array<Object>,
|
|
||||||
keyExtractor: Function,
|
|
||||||
renderItem: Function,
|
|
||||||
updateData: number,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* FlatList implementing PureComponent for increased performance.
|
|
||||||
*
|
|
||||||
* This is a pure component, meaning it will only update if a shallow comparison of state and props is different.
|
|
||||||
* To force the component to update, change the value of updateData.
|
|
||||||
*/
|
|
||||||
export default class PureFlatList extends React.PureComponent<Props> {
|
|
||||||
|
|
||||||
static defaultProps = {
|
|
||||||
updateData: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<FlatList
|
|
||||||
data={this.props.data}
|
|
||||||
keyExtractor={this.props.keyExtractor}
|
|
||||||
style={{minHeight: 300, width: '100%'}}
|
|
||||||
renderItem={this.props.renderItem}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue