Skip to content

Conversation

@sunesimonsen
Copy link
Contributor

@sunesimonsen sunesimonsen commented Nov 22, 2018

Description

We currently have situations where we get multiple requestAnimationFrame callbacks queued up and componentWillUnmount will only cancel the latest one. This results in settings the state on an unmounted component which React warns about.

This fix uses the more conventional way of using requestAnimationFrame, where you start a new animation frame at the end of the last one.

Detail

screen shot 2018-11-22 at 13 26 49

screen shot 2018-11-22 at 13 27 21

We currently have situations where we get multiple requestAnimationFrame
callbacks queued up and componentWillUnmount will only cancel the latest one.
This results in settings the state on an unmounted component which React warns
about.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 94.729% when pulling a347143 on ssimonsen/loaders-fix-runaway-callbacks into 374465e on master.

Copy link
Contributor

@ryanseddon ryanseddon left a comment

Choose a reason for hiding this comment

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

nice, thanks.

@ryanseddon ryanseddon merged commit 88e7032 into master Nov 22, 2018
@ryanseddon ryanseddon deleted the ssimonsen/loaders-fix-runaway-callbacks branch November 22, 2018 22:07
@sunesimonsen
Copy link
Contributor Author

Thanks 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants