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

Add a default state to useMedia hook #2780

Merged
merged 1 commit into from
Jan 30, 2022

Conversation

DukeManh
Copy link
Contributor

Issue This PR Addresses

Fixes #2672, this adds the default state to 'useMedia' hook call because otherwise the browser will fall back to false when server-side rendering which might not match the client's state.

https://github.com/streamich/react-use/blob/master/docs/useMedia.md#reference

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@DukeManh DukeManh self-assigned this Jan 30, 2022
@gitpod-io
Copy link

gitpod-io bot commented Jan 30, 2022

@DukeManh DukeManh merged commit 77e5d50 into Seneca-CDOT:master Jan 30, 2022
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.

useMedia When server side rendering, defaultState should be defined to prevent a hydration mismatches.
3 participants