Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove findDOMNode usage Table component
  • Loading branch information
henryqdineen committed Nov 14, 2024
commit f64b64ca03828dcd7232c7c5fc44aea45e44efb4
4 changes: 4 additions & 0 deletions source/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,10 @@ class Grid extends React.PureComponent<Props, State> {
}
}

getDOMNode() {
return this._scrollingContainer;
}

static _wrapSizeGetter(value: CellSize): CellSizeGetter {
return typeof value === 'function' ? value : () => (value: any);
}
Expand Down
3 changes: 1 addition & 2 deletions source/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import clsx from 'clsx';
import Column from './Column';
import PropTypes from 'prop-types';
import * as React from 'react';
import {findDOMNode} from 'react-dom';
import Grid, {accessibilityOverscanIndicesGetter} from '../Grid';

import defaultRowRenderer from './defaultRowRenderer';
Expand Down Expand Up @@ -339,7 +338,7 @@ export default class Table extends React.PureComponent {

getScrollbarWidth() {
if (this.Grid) {
const Grid = findDOMNode(this.Grid);
const Grid = this.Grid.getDOMNode();
const clientWidth = Grid.clientWidth || 0;
const offsetWidth = Grid.offsetWidth || 0;
return offsetWidth - clientWidth;
Expand Down