From c3ae3b6092597a4d884f9617ec1ce56292652ce0 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Mon, 18 Mar 2024 13:47:31 +0100 Subject: [PATCH] proptypes --- .../x-data-grid/src/components/GridPagination.tsx | 15 +++++++++++++-- .../src/components/cell/GridActionsCellItem.tsx | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/x-data-grid/src/components/GridPagination.tsx b/packages/x-data-grid/src/components/GridPagination.tsx index dbaecacea6614..7c7e65e0aa2ae 100644 --- a/packages/x-data-grid/src/components/GridPagination.tsx +++ b/packages/x-data-grid/src/components/GridPagination.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import PropTypes from 'prop-types'; import TablePagination, { tablePaginationClasses, TablePaginationProps, @@ -31,11 +32,11 @@ const GridPaginationRoot = styled(TablePagination)(({ theme }) => ({ type MutableArray = A extends readonly (infer T)[] ? T[] : never; -export const GridPagination = React.forwardRef< +const GridPagination = React.forwardRef< unknown, Partial< // See https://github.com/mui/material-ui/issues/40427 - Omit & { component: React.ElementType } + Omit & { component?: React.ElementType } > >(function GridPagination(props, ref) { const apiRef = useGridApiContext(); @@ -120,3 +121,13 @@ export const GridPagination = React.forwardRef< /> ); }); + +GridPagination.propTypes = { + // ----------------------------- Warning -------------------------------- + // | These PropTypes are generated from the TypeScript type definitions | + // | To update them edit the TypeScript types and run "yarn proptypes" | + // ---------------------------------------------------------------------- + component: PropTypes.elementType, +} as any; + +export { GridPagination }; diff --git a/packages/x-data-grid/src/components/cell/GridActionsCellItem.tsx b/packages/x-data-grid/src/components/cell/GridActionsCellItem.tsx index 846c4d62a4338..d11bd15188a02 100644 --- a/packages/x-data-grid/src/components/cell/GridActionsCellItem.tsx +++ b/packages/x-data-grid/src/components/cell/GridActionsCellItem.tsx @@ -83,6 +83,10 @@ GridActionsCellItem.propTypes = { // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the TypeScript types and run "yarn proptypes" | // ---------------------------------------------------------------------- + /** + * from https://mui.com/material-ui/api/button-base/#ButtonBase-prop-component + */ + component: PropTypes.elementType, icon: PropTypes.element, label: PropTypes.string.isRequired, showInMenu: PropTypes.bool,