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
[material-ui][TextField] TypeScript not working #41964
Comments
@mj12albert any ideas would be appreciated |
Can we have an update on the ticket, please? |
You could provide the type like this:
Pasted it from the docs |
Of course I could, the issue is that the rest of the props types are not being evaluated correctly. I can pass anything to any props. This does not ensure type safety |
I suggest to please ask on StackOverflow. |
👋 Thanks for using our open-source projects! We use GitHub issues exclusively as a bug and feature requests tracker, however, For support with Material UI please check out https://mui.com/material-ui/getting-started/support/. Thanks! If you have a question on Stack Overflow, you are welcome to link to it here, it might help others. |
The problem in depth
We are migrating some components(Dialogs , forms, etc) to a package so we can share code between projects.
Typescript is basically not working for the TextField component (it's only component showing this behaviour)
I think there's something wrong with the config in this project since it works fine in other project using the same mui packages versions.
Here are some examples of whats happening:
Basically typescript is not able to evaluate the types of the props. This is blocking me since the ci/cd need the tsc to pass.
Any help is apreciated
Your environment
System:
OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: 8.6.0 - ~/.local/share/pnpm/pnpm
Browsers:
Chrome: Not Found
npmPackages:
@emotion/react: 11.11.3
@emotion/styled: 11.11.0
@mui/icons-material: 5.15.15
@mui/lab: 5.0.0-alpha.163
@mui/material: 5.15.15
@mui/system: 5.15.15
@mui/x-data-grid: 6.19.9
@mui/x-data-grid-pro: 6.19.9
@mui/x-date-pickers: 6.19.6
@mui/x-date-pickers-pro: 6.19.6
@mui/x-tree-view: 7.1.0
@types/react: ^18.2.0 => 18.2.0
react: 18.2.0
react-dom: 18.2.0
typescript: ^5.4.5 => 5.4.5
Search keywords: typescript textfield
Order ID: 48634
The text was updated successfully, but these errors were encountered: