-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[Autocomplete] options does not accept const assertions array with TypeScript #24639
Comments
I'm not sure this is a bug or intend behavior, maybe this should be a feature request? |
@xiaoyu-tamu I have tried your fix but I can still see the error. I have no insights on this case. |
May i know what error you get from |
@oliviertassinari My bad, I made a typo. could you try |
@xiaoyu-tamu Ok, the TypeScript tests pass with the proposed change. Do you want to send a pull request (with a quick test under ( |
Sure, i'll give it a try, never write type test before. |
Hey @xiaoyu-tamu, @oliviertassinari - Would you mind If I open a PR for this? Happy to take it |
@silver-snoopy Sure thing, go ahead. |
ts Error
change the type to
options: Readonly<T[]>;
could fix the issue.Current Behavior 😯
TS Error
Expected Behavior 🤔
No TS Error
Your Environment 🌎
`npx @material-ui/envinfo`
npx: installed 2 in 1.753s
System:
OS: macOS 10.15.6
Binaries:
Node: 14.7.0 - /var/folders/7w/t3q6v18575b1rncctdm639040000gn/T/fnm-shell-709267/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.7 - /var/folders/7w/t3q6v18575b1rncctdm639040000gn/T/fnm-shell-709267/bin/npm
Browsers:
Chrome: 88.0.4324.96
Edge: Not Found
Firefox: 84.0.1
Safari: 14.0
npmPackages:
@emotion/react: 11.1.4 => 11.1.4
@emotion/styled: 11.0.0 => 11.0.0
@material-ui/core: next => 5.0.0-alpha.22
@material-ui/icons: next => 5.0.0-alpha.22
@material-ui/lab: next => 5.0.0-alpha.22
@material-ui/styled-engine: 5.0.0-alpha.22
@material-ui/styles: 5.0.0-alpha.22
@material-ui/system: 5.0.0-alpha.22
@material-ui/types: 5.1.4
@material-ui/unstyled: 5.0.0-alpha.22
@material-ui/utils: 5.0.0-alpha.22
@types/react: 17.0.0 => 17.0.0
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
typescript: 4.1.3 => 4.1.3
The text was updated successfully, but these errors were encountered: