forked from vergnet/application-amicale
Fixed proximo list sorting not working
This commit is contained in:
parent
651435dfc6
commit
35948ddfba
2 changed files with 15 additions and 0 deletions
|
@ -1,9 +1,23 @@
|
|||
import * as React from 'react';
|
||||
import {FlatList} from "react-native";
|
||||
|
||||
type Props = {
|
||||
data: Array<Object>,
|
||||
keyExtractor: Function,
|
||||
renderItem: Function,
|
||||
updateData: number,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -318,6 +318,7 @@ class ProximoListScreen extends React.Component<Props, State> {
|
|||
data={this.state.currentlyDisplayedData}
|
||||
keyExtractor={this.keyExtractor}
|
||||
renderItem={this.renderItem}
|
||||
updateData={this.state.currentSortMode}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue