diff --git a/src/TabPanelList/index.tsx b/src/TabPanelList/index.tsx index 22263540..07f1355a 100644 --- a/src/TabPanelList/index.tsx +++ b/src/TabPanelList/index.tsx @@ -25,47 +25,50 @@ const TabPanelList: React.FC = props => { return (
-
- {tabs.map(item => { - const { - key, - forceRender, - style: paneStyle, - className: paneClassName, - destroyOnHidden: itemDestroyOnHidden, - ...restTabProps - } = item; - const active = key === activeKey; - return ( - - {({ style: motionStyle, className: motionClassName }, ref) => ( - - )} - - ); - })} -
+ {tabs.map(item => { + const { + key, + forceRender, + style: paneStyle, + className: paneClassName, + destroyOnHidden: itemDestroyOnHidden, + ...restTabProps + } = item; + const active = key === activeKey; + return ( + + {({ style: motionStyle, className: motionClassName }, ref) => ( + + )} + + ); + })}
); }; diff --git a/tests/__snapshots__/index.test.tsx.snap b/tests/__snapshots__/index.test.tsx.snap index c4500f4e..b089ce3f 100644 --- a/tests/__snapshots__/index.test.tsx.snap +++ b/tests/__snapshots__/index.test.tsx.snap @@ -86,18 +86,14 @@ exports[`Tabs.Basic Normal 1`] = ` class="rc-tabs-content-holder" >
-
- Bamboo -
+ Bamboo
@@ -159,18 +155,14 @@ exports[`Tabs.Basic Skip invalidate children 1`] = ` class="rc-tabs-content-holder" >
-
- Light -
+ Light
diff --git a/tests/mobile.test.tsx b/tests/mobile.test.tsx index d8f4a4ef..9f3257cc 100644 --- a/tests/mobile.test.tsx +++ b/tests/mobile.test.tsx @@ -1,7 +1,6 @@ -import { render } from '@testing-library/react'; +import { render, act } from '@testing-library/react'; import { spyElementPrototypes } from '@rc-component/util'; import React from 'react'; -import { act } from 'react-dom/test-utils'; import type { TabsProps } from '../src'; import Tabs from '../src'; import { btnOffsetPosition, getOffsetSizeFunc, getTransformX } from './common/util'; diff --git a/tests/operation-overflow.test.tsx b/tests/operation-overflow.test.tsx index e508fd43..2adab3d6 100644 --- a/tests/operation-overflow.test.tsx +++ b/tests/operation-overflow.test.tsx @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-invalid-this */ -import { render } from '@testing-library/react'; +import { render, act } from '@testing-library/react'; import { spyElementPrototypes } from '@rc-component/util'; -import { act } from 'react-dom/test-utils'; import { getOffsetSizeFunc, getTabs, triggerResize } from './common/util'; describe('Tabs.Operation-Overflow', () => { diff --git a/tests/rtl.test.tsx b/tests/rtl.test.tsx index d372055e..044bb95f 100644 --- a/tests/rtl.test.tsx +++ b/tests/rtl.test.tsx @@ -1,6 +1,5 @@ -import { render } from '@testing-library/react'; +import { render, act } from '@testing-library/react'; import { spyElementPrototypes } from '@rc-component/util'; -import { act } from 'react-dom/test-utils'; import { getOffsetSizeFunc, getTabs, getTransformX, triggerResize } from './common/util'; // Same as `overflow.test.tsx` but use in RTL