Skip to content

Commit

Permalink
[DataGridPro] Fix the return type of useGridApiRef for Pro and Prem…
Browse files Browse the repository at this point in the history
…ium packages on React < 19 (#16328)
  • Loading branch information
arminmeh authored Jan 27, 2025
1 parent 435d09f commit f4923d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/x-data-grid-premium/src/hooks/utils/useGridApiRef.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { useGridApiRef as useCommunityGridApiRef } from '@mui/x-data-grid';
import { RefObject } from '@mui/x-internals/types';
import { GridApiCommon, useGridApiRef as useCommunityGridApiRef } from '@mui/x-data-grid';
import { GridApiPremium } from '../../models/gridApiPremium';

export const useGridApiRef = useCommunityGridApiRef<GridApiPremium>;
export const useGridApiRef: <Api extends GridApiCommon = GridApiPremium>() => RefObject<Api> =
useCommunityGridApiRef;
6 changes: 4 additions & 2 deletions packages/x-data-grid-pro/src/hooks/utils/useGridApiRef.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { useGridApiRef as useCommunityGridApiRef } from '@mui/x-data-grid';
import { RefObject } from '@mui/x-internals/types';
import { GridApiCommon, useGridApiRef as useCommunityGridApiRef } from '@mui/x-data-grid';
import { GridApiPro } from '../../models/gridApiPro';

export const useGridApiRef = useCommunityGridApiRef<GridApiPro>;
export const useGridApiRef: <Api extends GridApiCommon = GridApiPro>() => RefObject<Api> =
useCommunityGridApiRef;

0 comments on commit f4923d6

Please sign in to comment.