Skip to content

Commit 6b1e86f

Browse files
authored
Remove use of memo from table header and row (#4512)
1 parent 7ea85d3 commit 6b1e86f

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

webview/src/experiments/components/table/body/Row.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cx from 'classnames'
2-
import React, { memo, useCallback, useMemo } from 'react'
2+
import React, { useCallback, useMemo } from 'react'
33
import { useDispatch, useSelector } from 'react-redux'
44
import { EXPERIMENT_WORKSPACE_ID } from 'dvc/src/cli/dvc/contract'
55
import { StubCell, CellWrapper } from './Cell'
@@ -16,11 +16,9 @@ import {
1616
toggleRowSelected
1717
} from '../../../state/rowSelectionSlice'
1818

19-
const Row: React.FC<RowProp & { className?: string; isExpanded: boolean }> = ({
20-
row,
21-
isExpanded,
22-
className
23-
}): JSX.Element => {
19+
export const TableRow: React.FC<
20+
RowProp & { className?: string; isExpanded: boolean }
21+
> = ({ row, isExpanded, className }): JSX.Element => {
2422
const changes = useSelector(
2523
(state: ExperimentsState) => state.tableData.changes
2624
)
@@ -119,5 +117,3 @@ const Row: React.FC<RowProp & { className?: string; isExpanded: boolean }> = ({
119117
</ContextMenu>
120118
)
121119
}
122-
123-
export const TableRow = memo(Row)

webview/src/experiments/components/table/header/TableHead.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Experiment } from 'dvc/src/experiments/webview/contract'
2-
import React, { DragEvent, useRef, useEffect, memo } from 'react'
2+
import React, { DragEvent, useRef, useEffect } from 'react'
33
import { useSelector, useDispatch } from 'react-redux'
44
import {
55
Header,
@@ -28,7 +28,7 @@ interface TableHeadProps {
2828
setTableHeadHeight: (height: number) => void
2929
}
3030

31-
const THead = ({
31+
export const TableHead = ({
3232
columnOrder,
3333
headerGroups,
3434
setColumnOrder,
@@ -135,5 +135,3 @@ const THead = ({
135135
</thead>
136136
)
137137
}
138-
139-
export const TableHead = memo(THead)

0 commit comments

Comments
 (0)