Skip to content

Commit

Permalink
chore: refactor SliceAdder for react 17 and react 18 (#23009)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily Kuang authored Feb 7, 2023
1 parent 183c5f9 commit 493181c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
19 changes: 19 additions & 0 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
"react-transition-group": "^2.5.3",
"react-ultimate-pagination": "^1.3.0",
"react-virtualized": "9.19.1",
"react-virtualized-auto-sizer": "^1.0.7",
"react-window": "^1.8.8",
"redux": "^4.0.5",
"redux-localstorage": "^0.4.1",
Expand Down
12 changes: 7 additions & 5 deletions superset-frontend/src/dashboard/components/SliceAdder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
/* eslint-env browser */
import React from 'react';
import PropTypes from 'prop-types';
import { List, AutoSizer } from 'react-virtualized';
import AutoSizer from 'react-virtualized-auto-sizer';
import { FixedSizeList as List } from 'react-window';
import { createFilter } from 'react-search-input';
import {
t,
Expand Down Expand Up @@ -333,13 +334,14 @@ class SliceAdder extends React.Component {
<List
width={width}
height={height}
rowCount={this.state.filteredSlices.length}
rowHeight={DEFAULT_CELL_HEIGHT}
rowRenderer={this.rowRenderer}
itemCount={this.state.filteredSlices.length}
itemSize={DEFAULT_CELL_HEIGHT}
searchTerm={this.state.searchTerm}
sortBy={this.state.sortBy}
selectedSliceIds={this.props.selectedSliceIds}
/>
>
{this.rowRenderer}
</List>
)}
</AutoSizer>
</ChartList>
Expand Down

0 comments on commit 493181c

Please sign in to comment.