# Avoiding Hydration Mismatches with useSyncExternalStore

DevFeed: [Avoiding Hydration Mismatches with useSyncExternalStore](<https://devfeed.tech/articles/avoiding-hydration-mismatches-with-usesyncexternalstore-48176.md>)

Original publisher: [Read original article](<https://tkdodo.eu/blog/avoiding-hydration-mismatches-with-use-sync-external-store>)

Published: 2024-02-21T00:00:00Z

Content type: article

Language: en

Sources: [TkDodo](<https://devfeed.tech/sources/tkdodo-s-blog.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [browser](<https://devfeed.tech/topics/browser.md>), [client](<https://devfeed.tech/topics/client.md>), [Server](<https://devfeed.tech/topics/server.md>), [timezone](<https://devfeed.tech/topics/timezone.md>), [User Experience](<https://devfeed.tech/topics/user-experience.md>), [render](<https://devfeed.tech/topics/render.md>), [markup](<https://devfeed.tech/topics/markup.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [client](<https://devfeed.tech/tags/client.md>), [code](<https://devfeed.tech/tags/code.md>), [markup](<https://devfeed.tech/tags/markup.md>), [react](<https://devfeed.tech/tags/react.md>), [render](<https://devfeed.tech/tags/render.md>), [server](<https://devfeed.tech/tags/server.md>), [timezone](<https://devfeed.tech/tags/timezone.md>), [user-experience](<https://devfeed.tech/tags/user-experience.md>)

## AI overview

A React-focused article explains why server-rendered and client-rendered output can differ during hydration, especially when locale, timezone, or browser-only APIs are involved. It discusses suppressing warnings, rendering twice, and using effects to avoid hydration errors, along with the tradeoff of a brief flash of content.

## Source excerpt

Avoiding hydration mismatches can usually be done in two ways - suppressing the warning or spawning an effect. But is there a third option ... ?