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: exception thrown in useMediaQuery when unsupported, add option to disable the hook #1581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rawpixel-vincent
Copy link

fix #1580 and add an option to allow the match to be disabled conditionally

add tests 🟢

@rawpixel-vincent rawpixel-vincent force-pushed the pr/fix-1580 branch 3 times, most recently from fc88edd to 92d8832 Compare January 4, 2025 07:16
@rawpixel-vincent
Copy link
Author

rawpixel-vincent commented Jan 4, 2025

please review the test implementation, I've never used vitest before.

in the test should return undefined and not thrown on unsupported when not enabled:
I've verified that the console stub would throw when enabled is true

@rawpixel-vincent rawpixel-vincent changed the title fix: safari 13 exception thrown in useScreenOrientation, add enabled option to disable the match fix: exception thrown in useMediaQuery when unsupported, add option to disable the hook Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

useMediaQuery: unsupported query throw exception t.addEventListener is not a function
1 participant