-
-
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
slotProps and sx properties don't allow theme-based overrides in TypeScript #43522
Comments
I found a TypeScript bug, will open a PR soon. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note We value your feedback @eliprand! How was your experience with our support team? |
It looks like #43523 went out in v6.0.2, but updating I'm also still seeing the issue in a local project using v6.0.2. It also doesn't matter if it's a slot or sx prop directly on a component, nor if you use EDIT The type error happens with TS v5.5.4 but not older v5.4.5, and it also happens with v5.5.4 in |
@samsch hi! Thanks for reaching out. I think the issue you're encountering might be a TS configuration issue with StackBlitz. Running the same code in CodeSandbox doesn't show the issue: https://codesandbox.io/p/sandbox/issue-43522-material-ui-repro-xmtyqc |
Steps to reproduce
Link to live example: https://stackblitz.com/edit/react-1rixxg?file=Demo.tsx
Steps:
Popover
)sx
property of a slot (I usepaper
)t
as the theme prop)Current behavior
Here is the
Popover
example from the docs.TypeScript will complain about the type of
t
in thesx
prop for thepaper
slot:But the code runs just fine, as expected.
Expected behavior
TypeScript should recognize a theme-based override and not complain.
Context
Trying to override properties of a slot with theme-based values.
Your environment
npx @mui/envinfo
Search keywords: slotprops sx
The text was updated successfully, but these errors were encountered: