Skip to content

Commit

Permalink
fix(gregnb#1747): Replace deprecated props in mui based components
Browse files Browse the repository at this point in the history
- Used TransitionProps instead of the deprecated onClose and onExited Props for material-ui based Popover.

- Used onPageChange and onRowsPageChange Props instead of the deprecated onChangePage and onChangeRowsPerPage Props respectively, for material-ui based TablePagination.

- Used ref instead of the deprecated buttonRef for material-ui based IconButton .

(cherry picked from commit 25b8cb9)
  • Loading branch information
Kalaiz authored and bmlkc committed Feb 1, 2022
1 parent c331ae7 commit acf5496
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/components/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ const Popover = ({ className, trigger, refExit, hide, content, ...providedProps
<MuiPopover
elevation={2}
open={isOpen}
onClose={handleRequestClose}
onExited={handleOnExit}
TransitionProps={{ onExited: handleOnExit, onClose: handleRequestClose }}
anchorEl={anchorEl.current}
anchorOrigin={anchorOriginSpecs}
transformOrigin={transformOriginSpecs}
Expand Down
4 changes: 2 additions & 2 deletions src/components/TablePagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ function TablePagination(props) {
},
}}
rowsPerPageOptions={options.rowsPerPageOptions}
onChangePage={handlePageChange}
onChangeRowsPerPage={handleRowChange}
onPageChange={handlePageChange}
onRowsPerPageChange={handleRowChange}
/>
</div>
</MuiTableCell>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TableToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class TableToolbar extends React.Component {
<IconButton
aria-label={search}
data-testid={search + '-iconButton'}
buttonRef={el => (this.searchButton = el)}
ref={el => (this.searchButton = el)}
classes={{ root: this.getActiveIcon(classes, 'search') }}
disabled={options.search === 'disabled'}
onClick={this.handleSearchIconClick}>
Expand Down

0 comments on commit acf5496

Please sign in to comment.