From 219c21d1afe7224f29044e15cf7a92bf0b58f42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolas=20Schr=C3=B6ter?= <25958801+nwidynski@users.noreply.github.com> Date: Thu, 14 Aug 2025 01:05:08 +0200 Subject: [PATCH 1/3] fix: remove react-aria dependency --- .../virtualizer/src/useVirtualizerState.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/@react-stately/virtualizer/src/useVirtualizerState.ts b/packages/@react-stately/virtualizer/src/useVirtualizerState.ts index 9844e2acdd0..dfa5181991e 100644 --- a/packages/@react-stately/virtualizer/src/useVirtualizerState.ts +++ b/packages/@react-stately/virtualizer/src/useVirtualizerState.ts @@ -13,13 +13,19 @@ import {Collection, Key} from '@react-types/shared'; import {InvalidationContext} from './types'; import {Layout} from './Layout'; +import React, {useCallback, useMemo, useRef, useState} from 'react'; import {Rect} from './Rect'; import {ReusableView} from './ReusableView'; import {Size} from './Size'; -import {useCallback, useMemo, useRef, useState} from 'react'; -import {useLayoutEffect} from '@react-aria/utils'; import {Virtualizer} from './Virtualizer'; +// During SSR, React emits a warning when calling useLayoutEffect. +// Since neither useLayoutEffect nor useEffect run on the server, +// we can suppress this by replace it with a noop on the server. +export const useLayoutEffect: typeof React.useLayoutEffect = typeof document !== 'undefined' + ? React.useLayoutEffect + : () => {}; + interface VirtualizerProps { renderView(type: string, content: T | null): V, layout: Layout, From 449cb04ac4d967b6e0b06c5fac1f956247ca025b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolas=20Schr=C3=B6ter?= <25958801+nwidynski@users.noreply.github.com> Date: Thu, 14 Aug 2025 01:05:25 +0200 Subject: [PATCH 2/3] chore: update package.json --- packages/@react-stately/virtualizer/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/@react-stately/virtualizer/package.json b/packages/@react-stately/virtualizer/package.json index 6f7b543d25b..ea8f9a9edca 100644 --- a/packages/@react-stately/virtualizer/package.json +++ b/packages/@react-stately/virtualizer/package.json @@ -26,7 +26,6 @@ "url": "https://github.com/adobe/react-spectrum" }, "dependencies": { - "@react-aria/utils": "^3.30.0", "@react-types/shared": "^3.31.0", "@swc/helpers": "^0.5.0" }, From 9ab5c72c77639dea9aeb9e6f576ba7b27ed9ce61 Mon Sep 17 00:00:00 2001 From: Daniel Lu Date: Fri, 29 Aug 2025 14:49:51 -0700 Subject: [PATCH 3/3] update yarn.lock --- yarn.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 1c770a5f681..ee1fcc75171 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8390,7 +8390,6 @@ __metadata: version: 0.0.0-use.local resolution: "@react-stately/virtualizer@workspace:packages/@react-stately/virtualizer" dependencies: - "@react-aria/utils": "npm:^3.30.1" "@react-types/shared": "npm:^3.32.0" "@swc/helpers": "npm:^0.5.0" peerDependencies: