Skip to content

Commit c517136

Browse files
authored
Merge branch 'canary' into ts42
2 parents 00e73bf + 75bb24e commit c517136

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

src/Cell.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { forwardRef, memo, useRef } from 'react';
1+
import { forwardRef, memo } from 'react';
22
import clsx from 'clsx';
33

44
import type { CellRendererProps } from './types';
55
import { getCellStyle, wrapEvent } from './utils';
6-
import { useCombinedRefs } from './hooks';
76

87
function Cell<R, SR>({
98
className,
@@ -24,8 +23,6 @@ function Cell<R, SR>({
2423
selectRow,
2524
...props
2625
}: CellRendererProps<R, SR>, ref: React.Ref<HTMLDivElement>) {
27-
const cellRef = useRef<HTMLDivElement>(null);
28-
2926
const { cellClass } = column;
3027
className = clsx(
3128
'rdg-cell',
@@ -70,7 +67,7 @@ function Cell<R, SR>({
7067
role="gridcell"
7168
aria-colindex={column.idx + 1} // aria-colindex is 1-based
7269
aria-selected={isCellSelected}
73-
ref={useCombinedRefs(cellRef, ref)}
70+
ref={ref}
7471
className={className}
7572
style={getCellStyle(column)}
7673
onClick={wrapEvent(handleClick, onClick)}

src/hooks/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from './useCombinedRefs';
21
export * from './useClickOutside';
32
export * from './useGridDimensions';
43
export * from './useViewportColumns';

stories/demos/AllFeatures.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import faker from 'faker';
2-
import { useState, useRef } from 'react';
2+
import { useState } from 'react';
33
import DataGrid, { SelectColumn, TextEditor } from '../../src';
4-
import type { Column, DataGridHandle, FillEvent, PasteEvent } from '../../src';
4+
import type { Column, FillEvent, PasteEvent } from '../../src';
55
import DropDownEditor from './components/Editors/DropDownEditor';
66
import { ImageFormatter } from './components/Formatters';
77

@@ -184,7 +184,6 @@ export function AllFeatures() {
184184
const [rows, setRows] = useState(() => createRows(2000));
185185
const [selectedRows, setSelectedRows] = useState(() => new Set<React.Key>());
186186
const [isLoading, setIsLoading] = useState(false);
187-
const gridRef = useRef<DataGridHandle>(null);
188187

189188
function handleFill({ columnKey, sourceRow, targetRows }: FillEvent<Row>): Row[] {
190189
return targetRows.map(row => ({ ...row, [columnKey as keyof Row]: sourceRow[columnKey as keyof Row] }));
@@ -216,7 +215,6 @@ export function AllFeatures() {
216215
return (
217216
<div className="all-features">
218217
<DataGrid
219-
ref={gridRef}
220218
columns={columns}
221219
rows={rows}
222220
rowKeyGetter={rowKeyGetter}

stories/demos/components/HeaderRenderers/DraggableHeaderRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { DragObjectWithType } from 'react-dnd';
33

44
import { SortableHeaderCell } from '../../../../src';
55
import type { HeaderRendererProps } from '../../../../src';
6-
import { useCombinedRefs } from '../../../../src/hooks';
6+
import { useCombinedRefs } from '../../../useCombinedRefs';
77

88
interface ColumnDragObject extends DragObjectWithType {
99
key: string;

stories/demos/components/RowRenderers/DraggableRowRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import clsx from 'clsx';
44

55
import { Row } from '../../../../src';
66
import type { RowRendererProps } from '../../../../src';
7-
import { useCombinedRefs } from '../../../../src/hooks';
7+
import { useCombinedRefs } from '../../../useCombinedRefs';
88

99
import './DraggableRowRenderer.less';
1010

0 commit comments

Comments
 (0)