Skip to content
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

Generic type 'DateRangePickerDayProps ' requires 1 type argument(s). #28373

Closed
arunmmanoharan opened this issue Sep 15, 2021 · 2 comments
Closed
Labels
component: date range picker This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it typescript

Comments

@arunmmanoharan
Copy link

  • [ x] The issue is present in the latest release.
  • [ x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

npm build with tsc fails while using "@mui/lab": "^5.0.0-alpha.45",

Expected Behavior 🤔

"tsc" should pass

Steps to Reproduce 🕹

Steps:

  1. Run "tsc" on an app which uses "@mui/lab": "^5.0.0-alpha.45",

Context 🔦

Running the app using vite, "tsc" throws this error

image

Your Environment 🌎

{
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"types": ["vite/client","vite-plugin-svgr/client"],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"]
}

System:
OS: Windows 10 10.0.19043
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 6.49 GB / 31.71 GB
Binaries:
Node: 16.4.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 7.18.1 - C:\Program Files\nodejs\npm.CMD
Managers:
pip2: 18.1 - C:\Python27\Scripts\pip2.EXE
pip3: 20.1.1 - ~\AppData\Local\Programs\Python\Python37\Scripts\pip3.EXE
Utilities:
Git: 2.31.0. - /cmd/git
Virtualization:
Docker: 20.10.8 - C:\Program Files\Docker\Docker\resources\bin\docker.EXE
IDEs:
Visual Studio: 16.7.30621.155 (Visual Studio Community 2019)
Languages:
Java: 16.0.1 - /c/Program Files/Common Files/Oracle/Java/javapath/javac
Perl: 5.32.1 - C:\Program Files\Git\usr\bin\perl.EXE
Python: 3.7.9 - /c/Users/amanoharan/AppData/Local/Programs/Python/Python37/python
Browsers:
Chrome: 93.0.4577.63
Edge: Spartan (44.19041.1023.0), Chromium (93.0.961.47)
Internet Explorer: 11.0.19041.906

Using Chrome

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@arunmmanoharan arunmmanoharan added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 15, 2021
@eps1lon
Copy link
Member

eps1lon commented Sep 16, 2021

This is expected behavior. You need to specify the date type.

@eps1lon eps1lon closed this as completed Sep 16, 2021
@eps1lon eps1lon added component: date range picker This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it typescript and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 16, 2021
@jonathanrtuck
Copy link
Contributor

not sure why this was closed. this error occurs in mui's internal code, not the user's code. you can see in the error he posted that it is coming from node_modules/@mui/lab/themeAugmentation/props.d.ts.
i'm seeing the same error in a codebase that isn't even using DateRangePickerDay.

it looks like we just need to change DateRangePickerDayProps<TDate> to DateRangePickerDayProps<TDate = unknown> in https://github.com/mui-org/material-ui/blob/master/packages/mui-lab/src/DateRangePickerDay/DateRangePickerDay.tsx#L44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date range picker This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it typescript
Projects
None yet
Development

No branches or pull requests

3 participants