react-native-sortable-grid icon indicating copy to clipboard operation
react-native-sortable-grid copied to clipboard

Props not updating inside <SortableGrid>

Open stefanilie opened this issue 6 years ago • 6 comments

Hi @ollija, I have several 'cell's inside this sortable grid. Some cells have props connected to a remote API. Apparently the cells that are inside the sortable_grid don't update and those which are outside do update. My main question is: Do props inside <SortableGrid> are updatable?

<SortableGrid>
 <View style={styles.defaultCell} key={key_item}>
  <Text style={styles.cellTitle}>Availability</Text>
  <Text style={styles.cellValue}>{this.props.activity}%</Text>. //This doesn't update
 </View>
 </SortableGrid>
 <View style={styles.defaultCell} key={key_item}>
  <Text style={styles.cellTitle}>Availability</Text>
  <Text style={styles.cellValue}>{this.props.activity}%</Text>. //This does get updated
 </View>

stefanilie avatar Apr 16 '18 13:04 stefanilie

Try install dependency from github repository, not from npm.

krhovsky avatar Apr 25 '18 16:04 krhovsky

@krhovsky that worked for me, thanks!

ryanpatk avatar May 13 '18 17:05 ryanpatk

npm i react-native-sortable-grid@https://github.com/ollija/react-native-sortable-grid --save

fabianunger avatar May 30 '18 09:05 fabianunger

This still does not appear to be working for me. Trying to dynamically change the itemsPerRow with a button that changes local state. Are we sure this is still fixed?

stueynet avatar Feb 25 '19 13:02 stueynet

npm i react-native-sortable-grid@https://github.com/ollija/react-native-sortable-grid --save solved the problem, but resulted in another, the movement behaves differently than expected

luan-nvg avatar Aug 08 '20 01:08 luan-nvg

This still does not appear to be working for me. Trying to dynamically change the itemsPerRow with a button that changes local state. Are we sure this is still fixed?

I have the same problem, managed to solve?

luan-nvg avatar Aug 08 '20 02:08 luan-nvg