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 initial onResize delay caused by requestAnimationFrame #135

Merged
merged 1 commit into from
Apr 13, 2019
Merged

Fix initial onResize delay caused by requestAnimationFrame #135

merged 1 commit into from
Apr 13, 2019

Conversation

Jeffrey-Zutt
Copy link

@Jeffrey-Zutt Jeffrey-Zutt commented Apr 9, 2019

Immediately calls the onResize callback on componentDidMount.

The callback is now being called within a requestAnimationFrame to prevent a loop limit exceeded error #133.
However, this causes an initial delay and is noticeable in some applications.

@souporserious
Copy link
Owner

Ah, I've totally run into this before! Thank you for the fix! 🙏 I'm going to add an additional commit after I merge to suppress the initial call from the resize observer. I did something similar in the v3 branch, just never moved those fixes back into v2 😞.

@souporserious souporserious merged commit 8a6abd9 into souporserious:master Apr 13, 2019
@souporserious
Copy link
Owner

Published under 2.2.6 🎉. Thanks again!

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.

2 participants