-
-
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
[Textfield] TS2322 with slotProps inputLabel #44633
Comments
@sampain Can you share the repository? I cannot reproduce on my machine. |
I cannot share the repository, but I just found out that it's the spread operator in my custom Textfield componant that is causing the issue.
I also have the same issue if I try to do something like this:
Casting it like this seems to work, would that be the official way of doing this?
It seems specific to inputLabel however, with something like this, only inputLabel cause an error:
|
Im having the same problem but without using the spread operator, the only way I get it to work is by using the InputLabelprops which is deprecated. Is there any other way to alter the animation states of the Input labels ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hmm, I could not reproduce this. https://codesandbox.io/p/sandbox/pedantic-dijkstra-7jj5js?file=%2Fsrc%2FDemo.tsx%3A14%2C7 |
Can you provide a reproducible sandbox or a repo? |
I could not get a proper sandbox before I ran out of credits, but maybe it's still enough for you to investigate: https://codesandbox.io/p/devbox/dark-bird-qz96tr |
Steps to reproduce
Steps:
Returns
Current behavior
Error on build
Expected behavior
Suppose to build like
<TextField InputLabelProps={{ shrink: true }} />
Doc still suggest to use it this way even if InputLabelProps is deprecated: https://mui.com/material-ui/react-text-field/#shrink
Context
No response
Your environment
No response
Search keywords: TS2322 inputLabel slotProps Textfield
The text was updated successfully, but these errors were encountered: