From 52aee1dd54838abcdb529e6f1ccc6fba4699c379 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 8 Feb 2024 16:48:04 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#68539=20[react-dat?= =?UTF-8?q?a-grid]=20Remove=20usage=20of=20deprecated=20string=20refs=20in?= =?UTF-8?q?=20tests=20by=20@eps1lon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-data-grid/react-data-grid-tests.tsx | 5 +++-- types/react-data-grid/v1/react-data-grid-tests.tsx | 5 +++-- types/react-data-grid/v2/react-data-grid-tests.tsx | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/types/react-data-grid/react-data-grid-tests.tsx b/types/react-data-grid/react-data-grid-tests.tsx index c4a2cfc7ea2b08..2ea9ccafd7d5d3 100644 --- a/types/react-data-grid/react-data-grid-tests.tsx +++ b/types/react-data-grid/react-data-grid-tests.tsx @@ -244,6 +244,7 @@ var columns: Array> = [ ]; class Example extends React.Component { + gridRef = React.createRef>>(); getInitialState() { var fakeRows = createRows(2000); return { rows: fakeRows }; @@ -255,7 +256,7 @@ class Example extends React.Component { onClick: (ev: React.SyntheticEvent, args: { idx: number; rowIdx: number }) => { var idx = args.idx; var rowIdx = args.rowIdx; - (this.refs.grid as ReactDataGrid<{}>).openCellEditor(rowIdx, idx); + (this.gridRef.current!).openCellEditor(rowIdx, idx); }, }; @@ -330,7 +331,7 @@ class Example extends React.Component { let selectedRows = ["id1", "id2"]; return ( { + gridRef = React.createRef(); getInitialState() { var fakeRows = createRows(2000); return { rows: fakeRows }; @@ -201,7 +202,7 @@ class Example extends React.Component { onClick: (ev: React.SyntheticEvent, args: { idx: number; rowIdx: number }) => { var idx = args.idx; var rowIdx = args.rowIdx; - this.refs.grid as ReactDataGrid; + this.gridRef!; }, }; @@ -258,7 +259,7 @@ class Example extends React.Component { let selectedRows = ["id1", "id2"]; return ( { + gridRef = React.createRef(); getInitialState() { var fakeRows = createRows(2000); return { rows: fakeRows }; @@ -255,7 +256,7 @@ class Example extends React.Component { onClick: (ev: React.SyntheticEvent, args: { idx: number; rowIdx: number }) => { var idx = args.idx; var rowIdx = args.rowIdx; - (this.refs.grid as ReactDataGrid).openCellEditor(rowIdx, idx); + this.gridRef.current.openCellEditor(rowIdx, idx); }, }; @@ -333,7 +334,7 @@ class Example extends React.Component { let selectedRows = ["id1", "id2"]; return (