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

Moved Resize Listener into useEffect #59

Merged
merged 5 commits into from
Apr 17, 2021
Merged

Conversation

dominicboston
Copy link
Contributor

@dominicboston dominicboston commented Dec 7, 2020

Prevent overriding with default value on window resize due to using values when event listener was created. Instead, recreate event listener when values change and remove old event listener.
Fixing issue - #35

This reverts commit b375cec.
Moved window resize listener into useEffect to prevent resetting values to default on window resize.
Fixes issue Martin36#35
Prevent overriding with default value on window resize due to using values when event listener was created. Instead, recreate event listener when values change and remove old event listener.
Copy link

@AaronLayton AaronLayton left a comment

Choose a reason for hiding this comment

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

Changes look sound within React Hook standards when dealing with events

@Martin36 Martin36 merged commit d7047df into Martin36:master Apr 17, 2021
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