Skip to content

add canSetState property #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2016
Merged

add canSetState property #8

merged 1 commit into from
Dec 27, 2016

Conversation

zzq889
Copy link
Contributor

@zzq889 zzq889 commented Dec 25, 2016

resolve #6

@cooperka
Copy link
Owner

@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
Copy link
Contributor Author

zzq889 commented Dec 27, 2016

@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
Copy link
Owner

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!

@cooperka cooperka merged commit 14c5912 into cooperka:master Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning: setState(...): Can only update a mounted or mounting component
2 participants