From 6ea3ff8c27982c881ad3b541a1cf1fafaa6feec3 Mon Sep 17 00:00:00 2001 From: Ciffelia Date: Thu, 26 Jan 2023 15:25:03 +0900 Subject: [PATCH] Small fix --- packages/@react-aria/ssr/src/SSRProvider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@react-aria/ssr/src/SSRProvider.tsx b/packages/@react-aria/ssr/src/SSRProvider.tsx index ccb026ec312..1d74526c4ac 100644 --- a/packages/@react-aria/ssr/src/SSRProvider.tsx +++ b/packages/@react-aria/ssr/src/SSRProvider.tsx @@ -75,7 +75,7 @@ export type SSRIdOptions = const SSRIdOptionContext = React.createContext({mode: 'counter'}); -let canUseDOM = Boolean( +const canUseDOM = Boolean( typeof window !== 'undefined' && window.document && window.document.createElement @@ -94,7 +94,7 @@ export function SSRProvider({children, ...idOption}: SSRProviderProps): JSX.Elem let cur = useContext(SSRContext); let value: SSRContextValue = useMemo(() => { // If React strict mode is enabled, the function passed to `useMemo` will be called twice on the client. - // As a result, `ctx.current` will increase by two on the client side, causing hydration errors. + // As a result, `cur.current` will increase by two on the client side, causing hydration errors. // To avoid the error, we increase the counter to mimic this behavior on the server side. if (idOption.strictMode && !canUseDOM) { cur.current++;