Skip to content
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

Composition issues due to WithWrapperProps #288

Open
3 of 15 tasks
brionmario opened this issue Oct 14, 2024 · 1 comment
Open
3 of 15 tasks

Composition issues due to WithWrapperProps #288

brionmario opened this issue Oct 14, 2024 · 1 comment
Assignees
Labels
bug Something isn't working package:react Issues/PRs related to the `@oxygen-ui/react` package. typescript Issues related to typings

Comments

@brionmario
Copy link
Member

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 :

  • Affected Package:
    • @oxygen-ui/logger
    • @oxygen-ui/primitives
    • @oxygen-ui/react
    • @oxygen-ui/react-icons
  • Library Version: [e.g., 1.10.0, 2.0.0-alpha]
  • OS:
    • Windows
    • Linux
    • Mac
    • Other
  • Browser:
    • Google Chrome
    • Firefox
    • Safari
    • Microsoft Edge
    • Brave
    • Opera
    • Other
@brionmario brionmario added the bug Something isn't working label Oct 14, 2024
@brionmario brionmario self-assigned this Oct 14, 2024
@brionmario brionmario added package:react Issues/PRs related to the `@oxygen-ui/react` package. typescript Issues related to typings labels Oct 14, 2024
@brionmario
Copy link
Member Author

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: mui/material-ui#32420 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package:react Issues/PRs related to the `@oxygen-ui/react` package. typescript Issues related to typings
Projects
None yet
Development

No branches or pull requests

1 participant