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 useWindowSize not updating on orientation change #544

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

k-melnychuk
Copy link
Contributor

@k-melnychuk k-melnychuk commented Mar 16, 2024

This pull request fixes #530

There are a few changes though:

  1. To add orientation change handler (and not use deprecated window orietationchange event ) I had to add support for ScreenOrientation interface to useEventistener
  2. Updated useWindowSize to handle orientation change event
  3. Updated useWindowSize to not render multiple times even if window resize event or orientation change event fires multiple times unless window width or height change

Copy link

changeset-bot bot commented Mar 16, 2024

🦋 Changeset detected

Latest commit: 509e55f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
usehooks-ts Patch
www Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

[BUG] useWindowSize does not trigger on orientation change
1 participant