Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

[react-hooks] Do not throw when using useMedia in SSR without providing an initialValue#2813

Merged
melnikov-s merged 1 commit intomainfrom
use-media-fix-ssr
Jul 18, 2024
Merged

[react-hooks] Do not throw when using useMedia in SSR without providing an initialValue#2813
melnikov-s merged 1 commit intomainfrom
use-media-fix-ssr

Conversation

@melnikov-s
Copy link
Contributor

Description

Fixes (issue #)

We'll no longer throw if initialValue is not provided in SSR, though this will result in hydration mismatch and providing an initialValue should be considered required for SSR, but since there's no way to enforce this at type/build time we've opted to go with this approach instead.

Related discussion can be found here

@melnikov-s melnikov-s requested a review from a team as a code owner July 18, 2024 21:20
@melnikov-s melnikov-s requested a review from vsumner July 18, 2024 21:20
Copy link
Contributor

@jas7457 jas7457 left a comment

Choose a reason for hiding this comment

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

Thanks!

@melnikov-s melnikov-s merged commit 1171b00 into main Jul 18, 2024
@melnikov-s melnikov-s deleted the use-media-fix-ssr branch July 18, 2024 21:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants