Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. favoriteItem(rowKey, rowMap) {
  2. const { dataSource } = this.state;
  3. const prevIndex = dataSource.findIndex(item => item.id == rowKey);
  4. let newDataSource;
  5.  
  6. this.state.favoriteModal.setModalVisible(true, !dataSource[prevIndex].favorite);
  7.  
  8. dataSource[prevIndex].favorite = !dataSource[prevIndex].favorite;
  9.  
  10. newDataSource = dataSource;
  11.  
  12. this.setState({
  13. dataSource: newDataSource
  14. });
  15.  
  16. rowMap[rowKey].closeRow();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement