-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[system] Typing changed between 5.14.0 and 5.14.1 and later, when overriding an overridable property using styled #38626
Comments
It repros in a sandbox – I've added 2 sandboxes to the description, one showing the error on |
Thanks for the report! I'm taking a look. It's important to note that the Here's the comparison between |
I've identified that this is the cause of the issue, which was added to I'll continue to investigate, sharing this for anyone interested in taking a look or who might have insight into why this is happening. cc: @michaldudak |
I have yet to make time for this one. I added the |
@DiegoAndai we would like to pick this up |
@gitstart please do 😊 |
Duplicates
Latest version
Steps to reproduce 🕹
No error on
5.14.0
: https://codesandbox.io/s/issue-38626-5-14-0-q8xyfkError on
5.14.1
: https://codesandbox.io/s/issue-38626-5-14-1-n7z85w?file=/src/App.tsxLocal repro steps:
npx create-react-app mui-foo-chip --template typescript
npm i @mui/material@5.14.0 @emotion/react @emotion/styled
src/index.tsx
with code below./node_modules/typescript/bin/tsc --noEmit
- no typing errorsnpm i @mui/material@5.14.1
./node_modules/typescript/bin/tsc --noEmit
againCurrent behavior 😯
With 5.14.1 and later version you'll get the typescript error:
error TS2322: Type '"peace"' is not assignable to type '"default" | "primary" | "secondary" | "error" | "info" | "success" | "warning" | undefined'.
Expected behavior 🤔
I expected no typescript error.
Context 🔦
We want to re-use in this case the Chip component, but it will also have other properties such as emphasised and more states, hence we need to wrap the Chip component and at the same time we don't want to change Mui's own Chip component.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: