-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] TypeScript error on 'GridToolbarFilterButtonProps' after upgrading @mui/material to v5.0.3 #2804
Comments
Meanwhile $ tsc --project tsconfig.json && eslint --ignore-path .gitignore --fix --ext js,jsx,ts,tsx .
node_modules/@mui/x-data-grid-pro/x-grid.d.ts:2:23 - error TS2688: Cannot find type definition file for 'node'.
2 /// <reference types="node" />
~~~~
node_modules/@mui/x-data-grid-pro/x-grid.d.ts:2443:11 - error TS2430: Interface 'GridToolbarFilterButtonProps' incorrectly extends interface 'Omit<TooltipProps, "title" | "children">'.
Types of property 'componentsProps' are incompatible.
Type '{ button?: ButtonProps<"button", {}> | undefined; } | undefined' is not assignable to type '{ popper?: (PopperProps & TooltipComponentsPropsOverrides) | undefined; transition?: (TransitionProps & TooltipComponentsPropsOverrides) | undefined; tooltip?: (HTMLProps<...> & ... 1 more ... & TooltipComponentsPropsOverrides) | undefined; arrow?: (HTMLProps<...> & ... 1 more ... & TooltipComponentsPropsOverrides) ...'.
Type '{ button?: ButtonProps<"button", {}> | undefined; }' has no properties in common with type '{ popper?: (PopperProps & TooltipComponentsPropsOverrides) | undefined; transition?: (TransitionProps & TooltipComponentsPropsOverrides) | undefined; tooltip?: (HTMLProps<...> & ... 1 more ... & TooltipComponentsPropsOverrides) | undefined; arrow?: (HTMLProps<...> & ... 1 more ... & TooltipComponentsPropsOverrides) ...'.
2443 interface GridToolbarFilterButtonProps extends Omit<TooltipProps, 'title' | 'children'> {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@mui/x-data-grid-pro/x-grid.d.ts:3932:14 - error TS2503: Cannot find namespace 'NodeJS'.
3932 timeout: NodeJS.Timeout | null;
~~~~~~
Found 3 errors. |
To help us triage the problem, does downgrading |
Downgrading doesn't fix the issue, this is very strange as I didn't noticed it before. (I've already tried deleting |
mui/material-ui#28692 added the Here's a possible fix to close this issue: diff --git a/packages/grid/_modules_/grid/components/toolbar/GridToolbarFilterButton.tsx b/packages/grid/_modules_/grid/components/toolbar/GridToolbarFilterButton.tsx
index c654d102..7f4c8705 100644
--- a/packages/grid/_modules_/grid/components/toolbar/GridToolbarFilterButton.tsx
+++ b/packages/grid/_modules_/grid/components/toolbar/GridToolbarFilterButton.tsx
@@ -35,7 +35,9 @@ export interface GridToolbarFilterButtonProps extends Omit<TooltipProps, 'title'
* The props used for each slot inside.
* @default {}
*/
- componentsProps?: {
+ componentsProps?: ('componentsProps' extends keyof TooltipProps
+ ? Pick<TooltipProps, 'componentsProps'>
+ : {}) & {
button?: ButtonProps;
};
} |
I already enabled |
The correction is merged. It will be available in the next release |
Duplicates
Latest version
Current behavior 😯
After upgrading the core to the latest version (5.0.3) I'm getting this typescript error running
tsc
:Expected behavior 🤔
The app build works 😅
Steps to reproduce 🕹
Steps:
@mui/material
to v5.0.3tsc
Context 🔦
Relevant
package.json
content:Your environment 🌎
`npx @mui/envinfo`
Order ID 💳 (optional)
29385
The text was updated successfully, but these errors were encountered: