From b25b057959257a587a5e0ecf1715406a76bf1586 Mon Sep 17 00:00:00 2001 From: yoyo837 Date: Mon, 1 Dec 2025 14:27:42 +0800 Subject: [PATCH 1/2] migrate to @rc-component/virtual-list --- package.json | 4 ++-- src/VirtualTable/BodyGrid.tsx | 4 ++-- tests/Virtual.spec.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4e99a9bb2..12799fb54 100644 --- a/package.json +++ b/package.json @@ -52,8 +52,8 @@ "@rc-component/context": "^2.0.1", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.1.0", - "clsx": "^2.1.1", - "rc-virtual-list": "^3.14.2" + "@rc-component/virtual-list": "^1.0.0", + "clsx": "^2.1.1" }, "devDependencies": { "@rc-component/father-plugin": "^2.0.1", diff --git a/src/VirtualTable/BodyGrid.tsx b/src/VirtualTable/BodyGrid.tsx index e157281ba..f249b4ce5 100644 --- a/src/VirtualTable/BodyGrid.tsx +++ b/src/VirtualTable/BodyGrid.tsx @@ -1,5 +1,5 @@ import { useContext } from '@rc-component/context'; -import VirtualList, { type ListProps, type ListRef } from 'rc-virtual-list'; +import VirtualList, { type ListProps, type ListRef } from '@rc-component/virtual-list'; import * as React from 'react'; import TableContext, { responseImmutable } from '../context/TableContext'; import useFlattenRecords, { type FlattenData } from '../hooks/useFlattenRecords'; @@ -224,7 +224,7 @@ const Grid = React.forwardRef((props, ref) => { // ========================== Render ========================== const tblPrefixCls = `${prefixCls}-tbody`; - // default 'div' in rc-virtual-list + // default 'div' in @rc-component/virtual-list const wrapperComponent = getComponent(['body', 'wrapper']); // ========================== Sticky Scroll Bar ========================== diff --git a/tests/Virtual.spec.tsx b/tests/Virtual.spec.tsx index 2ee4226ff..0ff9d11ab 100644 --- a/tests/Virtual.spec.tsx +++ b/tests/Virtual.spec.tsx @@ -11,8 +11,8 @@ const identity = (value: any) => value; global.scrollToConfig = null; global.collectGetScrollInfoReturn = identity; -vi.mock('rc-virtual-list', async () => { - const RealVirtualList = ((await vi.importActual('rc-virtual-list')) as any).default; +vi.mock('@rc-component/virtual-list', async () => { + const RealVirtualList = ((await vi.importActual('@rc-component/virtual-list')) as any).default; const WrapperVirtualList = React.forwardRef((props: any, ref) => { const myRef = React.useRef(null); From d6f8b18b331ea6d9647bdd7564d69184e421f5f4 Mon Sep 17 00:00:00 2001 From: Amumu Date: Mon, 1 Dec 2025 16:53:03 +0800 Subject: [PATCH 2/2] Apply suggestion from @yoyo837 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 12799fb54..8604f677e 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@rc-component/context": "^2.0.1", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.1.0", - "@rc-component/virtual-list": "^1.0.0", + "@rc-component/virtual-list": "^1.0.1", "clsx": "^2.1.1" }, "devDependencies": {