Open MonstraG opened 2 months ago
I guess I could rewrite the entrie thing as a giant sx, but that is not very easy.
If I use styled("span"), then I loose the system prop (or sx).
You will lose the system prop which is expected because it's deprecated. However, the sx
prop still works.
https://codesandbox.io/p/sandbox/exciting-davinci-jhsk24?file=%2Fsrc%2FDemo.tsx%3A14%2C1
I think we could improve the Codemod to transform the system props for arbitrary components.
Hm, if styled() adds sx prop, then this is not an issue anymore. I didn't expect that, is it mentioned in the docs?
Hm, if styled() adds sx prop, then this is not an issue anymore. I didn't expect that, is it mentioned in the docs?
Good point, I don't see any page mention about this. I think it should be in https://mui.com/material-ui/customization/how-to-customize/#2-reusable-component
Related page
https://mui.com/material-ui/migration/upgrade-to-v6/#breaking-changes-affecting-types
Kind of issue
Unclear explanations
Issue description
What to do if I have:
?
Context
Example of a real 2-y/o piece of code that I'm trying to migrate from v5 to v6:
That is later used as
So I have the combination of a) custom prop b) system prop (will be sx) c) component.
If I use
styled("span")
, then I loose the system prop (or sx). If i usestyled(Box) as typeof Box
then I loose the type for custom prop.What do I do?
Search keywords: Box component styled custom props