Skip to content
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

Unmount state fix #114

Merged
merged 2 commits into from
Jul 24, 2018
Merged

Conversation

xiaotian-tan
Copy link

I encountered issue when componentWillUnmount try to update active on undefined.

So I made small change to componentWillUnmount to make state updates safer.

A additional section in demo is added to demonstrate cached avatars as well.

@JorgenEvens
Copy link
Member

Your issue would mean that unmount is called while the component is in a state transition, which should not happen. What version of React is this?

I'm afraid that by merging this PR we are bringing back the issue reported in #112. Let me try this out tonight and I'll let you know how it went.

@JorgenEvens JorgenEvens self-assigned this Jul 19, 2018
@JorgenEvens JorgenEvens added this to the 3.1.2 milestone Jul 19, 2018
@zedissime
Copy link

@JorgenEvens Any updates about this issue ?

@JorgenEvens
Copy link
Member

@zedissime I only had a quick look and was unable to reproduce the issue described. Letting me know which version of React you are using and maybe a small reproduction case would be helpful.

@zedissime
Copy link

@JorgenEvens I'm facing it in React 16.3.2, I'll update it.
In my case, I have an customer index page with an avatar for each one.
I leave the page (with react-router-dom), and when I want to come back on the page, the error is thrown.

@JorgenEvens
Copy link
Member

@zedissime Thanks, I'm gonna try reproduce this later today.

@zedissime
Copy link

Just in case of, I did update React in 16.4.1 and it is still happening.

@JorgenEvens
Copy link
Member

JorgenEvens commented Jul 24, 2018

@zedissime @xiaotian-tan @krue-doug I am unable to reproduce the issue, and I would really like to find out why componentWillUnmount is called before the state transition completes.

I've created a test-case on codesandbox, could you let me know if either the Toggle or Increment buttons trigger the above issue. And if not help me get a reproduction going here.

It broke 🎉

@JorgenEvens
Copy link
Member

Managed to check that this does not bring back #112.

Thanks @xiaotian-tan for the bug report and @zedissime for some help on reproducing the issue.

@JorgenEvens JorgenEvens merged commit 2dac9ac into ambassify:master Jul 24, 2018
@JorgenEvens
Copy link
Member

This PR is released as part of v3.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants