From 80404164f6de3c5d1caf6ec18d88ac5e7257a311 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 22 Dec 2024 00:10:03 +0000 Subject: [PATCH] -1 forwardRef --- src/Cell.tsx | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/Cell.tsx b/src/Cell.tsx index 29cd201693..f9d4da5bf9 100644 --- a/src/Cell.tsx +++ b/src/Cell.tsx @@ -1,4 +1,4 @@ -import { forwardRef, memo, type RefAttributes } from 'react'; +import { memo, type RefAttributes } from 'react'; import { css } from '@linaria/core'; import { useRovingTabIndex } from './hooks'; @@ -25,26 +25,23 @@ const cellDraggedOver = css` const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`; -function Cell( - { - column, - colSpan, - isCellSelected, - isCopied, - isDraggedOver, - row, - rowIdx, - className, - onClick, - onDoubleClick, - onContextMenu, - onRowChange, - selectCell, - style, - ...props - }: CellRendererProps, - ref: React.Ref -) { +function Cell({ + column, + colSpan, + isCellSelected, + isCopied, + isDraggedOver, + row, + rowIdx, + className, + onClick, + onDoubleClick, + onContextMenu, + onRowChange, + selectCell, + style, + ...props +}: CellRendererProps) { const { tabIndex, childTabIndex, onFocus } = useRovingTabIndex(isCellSelected); const { cellClass } = column; @@ -101,7 +98,6 @@ function Cell( aria-colspan={colSpan} aria-selected={isCellSelected} aria-readonly={!isEditable || undefined} - ref={ref} tabIndex={tabIndex} className={className} style={{ @@ -126,7 +122,7 @@ function Cell( ); } -const CellComponent = memo(forwardRef(Cell)) as ( +const CellComponent = memo(Cell) as ( props: CellRendererProps & RefAttributes ) => React.JSX.Element;