cooperka / react-native-immutable-list-view

:scroll: Drop-in replacement for ListView, FlatList, and VirtualizedList.
MIT License
205 stars 30 forks source link

add canSetState property #8

Closed zzq889 closed 7 years ago

zzq889 commented 7 years ago

resolve #6

cooperka commented 7 years ago

@zzq889 are you getting issue #6 also? Do you have any repro steps (or, even better, a sample app)? I'd like to tackle the root cause rather than just suppress the warning like this.

zzq889 commented 7 years ago

@cooperka I met this issue when I pop an instance view of react-native-tab-view which contains a ImmutableListView for each tab. I suppress the warning because it won't affect any UI problem.

cooperka commented 7 years ago

Thanks for the info @zzq889, it makes sense now why the warning happens. Since setState is being called asynchronously in runAfterInteractions, that makes it particularly likely to have issues. I refactored your commit a tiny bit to clean up, and it LGTM!