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

fix(Visibility): cancel RAF on component unmount #2635

Merged
merged 1 commit into from
Mar 11, 2018

Conversation

layershifter
Copy link
Member

Fixes #2570.
Replaces #2571.

Details

Visibility runs the update() method inside requestAnimationFrame(). It can be called after the component's unmount and will cause an exception as the ref inside the component stopped to exist.

This PR adds cancelAnimationFrame() to componentWillUnmount() that will stop RAF's action if component will be unmounted.

@codecov-io
Copy link

Codecov Report

Merging #2635 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2635      +/-   ##
==========================================
+ Coverage   99.74%   99.74%   +<.01%     
==========================================
  Files         160      160              
  Lines        2750     2751       +1     
==========================================
+ Hits         2743     2744       +1     
  Misses          7        7
Impacted Files Coverage Δ
src/behaviors/Visibility/Visibility.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d35a31c...1bbcb43. Read the comment docs.

@layershifter layershifter merged commit 3c408fa into master Mar 11, 2018
@layershifter layershifter deleted the fix/visibility-unmount branch March 11, 2018 13:27
Brantron pushed a commit to Brantron/Semantic-UI-React that referenced this pull request Mar 14, 2018
@levithomason
Copy link
Member

Released in semantic-ui-react@0.79.0.

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.

3 participants