Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Reorder code to avoid setting state on unmounted component #3139

Merged
merged 3 commits into from
Jun 21, 2019
Merged

Reorder code to avoid setting state on unmounted component #3139

merged 3 commits into from
Jun 21, 2019

Conversation

jasonpaulos
Copy link
Contributor

This solves the problem of the Subscription component being unmounted as a result of onSubscriptionData, then setState causing a React warning. See #2681 for a complete description of the issue.

jasonpaulos and others added 2 commits June 19, 2019 14:17
This solves the problem of the component being unmounted as a result
of onSubscriptionData, then setState causing a React warning. See #2681.
Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @jasonpaulos! Normally I'd say we need a test here so we don't regress on this in the future, but we're handling this a bit differently in RA 3 (and check mount status first) so let's go ahead and get this included in the final RA 2 release.

@hwillson hwillson merged commit dca8f7a into apollographql:master Jun 21, 2019
hwillson added a commit that referenced this pull request Jun 21, 2019
This will make sure `onSubscriptionData` has access to the most
up to date subscription result.

Relates to #3139.
@jasonpaulos jasonpaulos deleted the issue2681 branch June 21, 2019 17:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants