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 user of useScreen not rerendering on screen resize #280

Closed
wants to merge 1 commit into from

Conversation

philipgher
Copy link

The component that uses the useScreen hook will not rerender in it's current state due to window.screen maintaining it's reference. Thus calling setScreen is not triggering a rerender. Fixed by creating a shallow clone of the new screen object.

@juliencrn juliencrn added the bug Something isn't working label Jan 23, 2024
@juliencrn
Copy link
Owner

Hi @philipgher,
Thanks for the PR, unfortunately, this PR is too old now, but I applied your change to #474 and will add you to the contributor list. The fix will be in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants