mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.53k stars 1.32k forks source link

[charts] undefined type zoom #15386

Open tanjiarui opened 1 day ago

tanjiarui commented 1 day ago

Steps to reproduce

Link to live example: (required) https://codesandbox.io/embed/86q369?module=/src/Demo.tsx&fontsize=12

Current behavior

in fact, the zoom feature is working well, but a type error is always there. is there a way to eliminate this error? error

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo ``` System: OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish) Binaries: Node: 20.11.1 - /usr/local/bin/node npm: 10.9.0 - /usr/local/bin/npm pnpm: Not Found Browsers: Chrome: edge npmPackages: @emotion/react: ^11.13.3 => 11.13.3 @emotion/styled: ^11.13.0 => 11.13.0 @mui/core-downloads-tracker: 6.1.6 @mui/icons-material: ^6.1.1 => 6.1.1 @mui/material: ^6.1.6 => 6.1.6 @mui/private-theming: 6.1.6 @mui/styled-engine: 6.1.6 @mui/system: 6.1.6 @mui/types: 7.2.19 @mui/utils: 6.1.6 @mui/x-charts: 7.22.2 @mui/x-charts-pro: ^7.0.0-beta.6 => 7.0.0-beta.7 @mui/x-charts-vendor: 7.20.0 @mui/x-data-grid: 7.18.0 @mui/x-data-grid-premium: ^7.18.0 => 7.18.0 @mui/x-data-grid-pro: 7.18.0 @mui/x-date-pickers: 7.22.1 @mui/x-date-pickers-pro: ^7.22.1 => 7.22.1 @mui/x-internals: 7.18.0 @mui/x-license: 7.18.0 @types/react: ^18.3.3 => 18.3.10 react: ^18.3.1 => 18.3.1 react-dom: ^18.3.1 => 18.3.1 typescript: ^5.5.3 => 5.6.2 ```

node ts config

{
  "compilerOptions": {
    "target": "ES2022",
    "lib": [
      "ES2023"
    ],
    "module": "ESNext",
    "skipLibCheck": true,
    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "isolatedModules": true,
    "moduleDetection": "force",
    "noEmit": true,
    /* Linting */
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true
  },
  "include": [
    "vite.config.ts"
  ]
}

app ts config

{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "lib": [
      "ES2020",
      "DOM",
      "DOM.Iterable"
    ],
    "module": "ESNext",
    "skipLibCheck": true,
    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "isolatedModules": true,
    "moduleDetection": "force",
    "noEmit": true,
    "jsx": "react-jsx",
    /* Linting */
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true
  },
  "include": [
    "src"
  ]
}

Search keywords: zoom

alexfauquette commented 1 day ago

Yes, that's because we forgot a type overload import. You can already fix it with

import {} from "@mui/x-charts-pro/typeOverloads";
michelengelen commented 18 hours ago

@alexfauquette is there a PR that fixed this we can link here? I see that the error does not show with intellisense anymore