Skip to content

Commit

Permalink
proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Mar 18, 2024
1 parent 1dfbc3f commit c3ae3b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/x-data-grid/src/components/GridPagination.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import TablePagination, {
tablePaginationClasses,
TablePaginationProps,
Expand Down Expand Up @@ -31,11 +32,11 @@ const GridPaginationRoot = styled(TablePagination)(({ theme }) => ({

type MutableArray<A> = 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<TablePaginationProps, 'component'> & { component: React.ElementType }
Omit<TablePaginationProps, 'component'> & { component?: React.ElementType }
>
>(function GridPagination(props, ref) {
const apiRef = useGridApiContext();
Expand Down Expand Up @@ -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 };
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c3ae3b6

Please sign in to comment.