Skip to content

Commit 3795199

Browse files
authored
chore: rm useless code (#933)
1 parent a9e55ab commit 3795199

File tree

1 file changed

+7
-34
lines changed

1 file changed

+7
-34
lines changed

src/Table.tsx

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import isVisible from 'rc-util/lib/Dom/isVisible';
3232
import { isStyleSupport } from 'rc-util/lib/Dom/styleChecker';
3333
import { getTargetScrollBarSize } from 'rc-util/lib/getScrollBarSize';
3434
import useEvent from 'rc-util/lib/hooks/useEvent';
35-
import isEqual from 'rc-util/lib/isEqual';
3635
import pickAttrs from 'rc-util/lib/pickAttrs';
3736
import getValue from 'rc-util/lib/utils/get';
3837
import warning from 'rc-util/lib/warning';
@@ -41,7 +40,8 @@ import Body from './Body';
4140
import ColGroup from './ColGroup';
4241
import { EXPAND_COLUMN } from './constant';
4342
import TableContext from './context/TableContext';
44-
import FixedHolder, { FixedHeaderProps } from './FixedHolder';
43+
import type { FixedHeaderProps } from './FixedHolder';
44+
import FixedHolder from './FixedHolder';
4545
import Footer, { FooterComponents } from './Footer';
4646
import type { SummaryProps } from './Footer/Summary';
4747
import Summary from './Footer/Summary';
@@ -84,27 +84,6 @@ const EMPTY_SCROLL_TARGET = {};
8484

8585
export const INTERNAL_HOOKS = 'rc-table-internal-hook';
8686

87-
interface MemoTableContentProps {
88-
children: React.ReactNode;
89-
pingLeft: boolean;
90-
pingRight: boolean;
91-
props: any;
92-
}
93-
94-
const MemoTableContent = React.memo<MemoTableContentProps>(
95-
({ children }) => children as React.ReactElement,
96-
97-
(prev, next) => {
98-
if (!isEqual(prev.props, next.props, true)) {
99-
return false;
100-
}
101-
102-
// No additional render when pinged status change.
103-
// This is not a bug.
104-
return prev.pingLeft !== next.pingLeft || prev.pingRight !== next.pingRight;
105-
},
106-
);
107-
10887
export interface TableProps<RecordType = unknown>
10988
extends Omit<LegacyExpandableProps<RecordType>, 'showExpandColumn'> {
11089
prefixCls?: string;
@@ -731,17 +710,11 @@ function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<Reco
731710
ref={fullTableRef}
732711
{...dataProps}
733712
>
734-
<MemoTableContent
735-
pingLeft={pingedLeft}
736-
pingRight={pingedRight}
737-
props={{ ...props, stickyOffsets, mergedExpandedKeys }}
738-
>
739-
{title && <Panel className={`${prefixCls}-title`}>{title(mergedData)}</Panel>}
740-
<div ref={scrollBodyContainerRef} className={`${prefixCls}-container`}>
741-
{groupTableNode}
742-
</div>
743-
{footer && <Panel className={`${prefixCls}-footer`}>{footer(mergedData)}</Panel>}
744-
</MemoTableContent>
713+
{title && <Panel className={`${prefixCls}-title`}>{title(mergedData)}</Panel>}
714+
<div ref={scrollBodyContainerRef} className={`${prefixCls}-container`}>
715+
{groupTableNode}
716+
</div>
717+
{footer && <Panel className={`${prefixCls}-footer`}>{footer(mergedData)}</Panel>}
745718
</div>
746719
);
747720

0 commit comments

Comments
 (0)