Skip to content

Commit

Permalink
Remove use of memo from table header and row
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Aug 16, 2023
1 parent 7ea85d3 commit 4bc7a44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
12 changes: 4 additions & 8 deletions webview/src/experiments/components/table/body/Row.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames'
import React, { memo, useCallback, useMemo } from 'react'
import React, { useCallback, useMemo } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { EXPERIMENT_WORKSPACE_ID } from 'dvc/src/cli/dvc/contract'
import { StubCell, CellWrapper } from './Cell'
Expand All @@ -16,11 +16,9 @@ import {
toggleRowSelected
} from '../../../state/rowSelectionSlice'

const Row: React.FC<RowProp & { className?: string; isExpanded: boolean }> = ({
row,
isExpanded,
className
}): JSX.Element => {
export const TableRow: React.FC<
RowProp & { className?: string; isExpanded: boolean }
> = ({ row, isExpanded, className }): JSX.Element => {
const changes = useSelector(
(state: ExperimentsState) => state.tableData.changes
)
Expand Down Expand Up @@ -119,5 +117,3 @@ const Row: React.FC<RowProp & { className?: string; isExpanded: boolean }> = ({
</ContextMenu>
)
}

export const TableRow = memo(Row)
6 changes: 2 additions & 4 deletions webview/src/experiments/components/table/header/TableHead.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Experiment } from 'dvc/src/experiments/webview/contract'
import React, { DragEvent, useRef, useEffect, memo } from 'react'
import React, { DragEvent, useRef, useEffect } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import {
Header,
Expand Down Expand Up @@ -28,7 +28,7 @@ interface TableHeadProps {
setTableHeadHeight: (height: number) => void
}

const THead = ({
export const TableHead = ({
columnOrder,
headerGroups,
setColumnOrder,
Expand Down Expand Up @@ -135,5 +135,3 @@ const THead = ({
</thead>
)
}

export const TableHead = memo(THead)

0 comments on commit 4bc7a44

Please sign in to comment.