Skip to content

Commit 6ea3ff8

Browse files
committed
Small fix
1 parent e8d8877 commit 6ea3ff8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@react-aria/ssr/src/SSRProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export type SSRIdOptions =
7575

7676
const SSRIdOptionContext = React.createContext<SSRIdOptions>({mode: 'counter'});
7777

78-
let canUseDOM = Boolean(
78+
const canUseDOM = Boolean(
7979
typeof window !== 'undefined' &&
8080
window.document &&
8181
window.document.createElement
@@ -94,7 +94,7 @@ export function SSRProvider({children, ...idOption}: SSRProviderProps): JSX.Elem
9494
let cur = useContext(SSRContext);
9595
let value: SSRContextValue = useMemo(() => {
9696
// If React strict mode is enabled, the function passed to `useMemo` will be called twice on the client.
97-
// As a result, `ctx.current` will increase by two on the client side, causing hydration errors.
97+
// As a result, `cur.current` will increase by two on the client side, causing hydration errors.
9898
// To avoid the error, we increase the counter to mimic this behavior on the server side.
9999
if (idOption.strictMode && !canUseDOM) {
100100
cur.current++;

0 commit comments

Comments
 (0)