Skip to content

Commit 77167dc

Browse files
authored
[react-v2.2.2-alpha.3]: Fix - Next.js SSR support (#1118)
* next js SSR support * package bump
1 parent b8db389 commit 77167dc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.2.2-alpha.2",
3+
"version": "2.2.2-alpha.3",
44
"description": "Collection of React Hooks for web3-onboard",
55
"repository": "blocknative/web3-onboard",
66
"module": "dist/index.js",

packages/react/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ const useAppState: {
5151
return stateKey ? snapshot[stateKey] : snapshot
5252
}, [stateKey])
5353

54-
return useSyncExternalStore(subscribe, getSnapshot)
54+
const getServerSnapshot = () => get() || getSnapshot;
55+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
5556
}
5657

5758
export const useConnectWallet = (): [

0 commit comments

Comments
 (0)