What is the use of name and slot in the styled API?
am using MUI to create my own component library. I was tempted to use the styled API to use create all components and their sub-components. But later I found out that in order to override any style of a component or a subcomponent, I would need to pass my own className as noted here. This applies to styling via sx prop as well as styled API.
Another place where I thought the name and slot would help is in theming using createTheme, but it seems that it actually relies on the overridesResolver to do that.
The only place where the name and slot was useful was in creating the className for the component (that too hash prefixed, so useless for CSS targeting) and the displayName in the React devtools.
What is the use of name and slot in the styled API?
am using MUI to create my own component library. I was tempted to use the styled API to use create all components and their sub-components. But later I found out that in order to override any style of a component or a subcomponent, I would need to pass my own className as noted here. This applies to styling via sx prop as well as styled API.
Another place where I thought the name and slot would help is in theming using createTheme, but it seems that it actually relies on the overridesResolver to do that.
The only place where the name and slot was useful was in creating the className for the component (that too hash prefixed, so useless for CSS targeting) and the displayName in the React devtools.
is working on a reply...