wso2 / oxygen-ui

The Design System powering WSO2 products.
https://wso2.github.io/oxygen-ui
Apache License 2.0
43 stars 24 forks source link

Composition issues due to `WithWrapperProps` #288

Open brionmario opened 2 days ago

brionmario commented 2 days ago

Describe the issue:

If we use another composed MUI component in the component prop, typings break with the following error.

Screenshot 2024-10-14 at 13 58 31

Uppon investigation, it was found that extending OverridableComponent with WithWrapperProps; is the culprit.

How to reproduce:

Try to use a composed MUI component in the component pro and access an attribute specific to that component. (elevation is specific to Paper)

ex:

<Button component={Paper} elevation={0} />;

Expected behavior:

Typescript shouldn't complain and intenseness should work.

Additional context :

brionmario commented 2 days ago

As a temp workaround, we can remove the usage of muiName in the composed components.

I've already raised this concern in an existing MUI discussion: https://github.com/mui/material-ui/issues/32420#issuecomment-2410430433