Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

Detail list refreshing issue after sorting on checkbox change event

$
0
0

I have implemented the sorting functionality ,I have used constructor to initialize the state and componentDidUpdate to update the state with new items.

constructor(props) {this.state = {  items: props.items }}public componentDidUpdate(oldProps: FallbackFormContainerProps) {if (oldProps.items!== this.props.items) {  this.setState({    items: this.props.items  });}}OnColumnSorting() { //sorting and set state this.setState({    columns: newColumns,    items: newItems  });}

On check box changed event

private OnChange= (formId: string, checked?: boolean): void => {//change event

};

But the problem is that after sorting if i am changing the check box change event then I am getting new props which have different order than my state , so detail list is refreshing with new order,How i can revoke that only change event will fire not whole detail list will refresh


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>