Skip to content

Commit

Permalink
fix: hydration check (#3715)
Browse files Browse the repository at this point in the history
* fix: hydration check

* Create soft-coats-burn.md

* Update soft-coats-burn.md
  • Loading branch information
jxom committed Mar 18, 2024
1 parent f1628d6 commit d56edf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/soft-coats-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wagmi/core": patch
"wagmi": patch
---

Fixed SSR hydration issues.
2 changes: 1 addition & 1 deletion packages/core/src/hydrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type HydrateParameters = {
export function hydrate(config: Config, parameters: HydrateParameters) {
const { initialState, reconnectOnMount } = parameters

if (initialState)
if (initialState && !config._internal.store.persist.hasHydrated())
config.setState({
...initialState,
connections: reconnectOnMount ? initialState.connections : new Map(),
Expand Down

0 comments on commit d56edf4

Please sign in to comment.