-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Add shouldForwardProp
to theme
#34831
Comments
This would be a great feature to have and I am currently having the same issue. Is there anyone working on this and if not could you maybe point me to the respective place in the codebase where this could be added? I could add that feature myself in that case. cc @siriwatknp Thanks in advance! |
Any updates? |
Please don't let this one die :) |
@mnajdova A new use case for the variants API. This case needs to style based on the ownerState, not just props. |
We'd like to have this too |
Hi @mnajdova Is there any update on this, its really very helpful feature. |
The issue itself looks like a duplicate of #19466, it's about supporting additional props in the components. The decision is about whether creating a wrapper component as an API is easier/more intuitive in comparison with a new API about specifying which props should be propagated. I am tagging @aarongarciah so we can include this in the planning for the next theming customization/experience. If we decide to add this support in one of the next majors, we can likely backport it in v6 too. |
Duplicate of #19466 |
@mnajdova IMO, we can create a wrapper component and it's good when we have some additional features to add. But for simple changes like just giving support of |
We have the same problem, for example, that we introduce the prop
As far as I understand, there should be a way to override which props are forwarded in the theme for a component, like |
Duplicates
Latest version
Summary 💡
I'm using a custom property to create custom variants for OutlinedInput.
The problem is that I need to pass the property to the component for the theme to have it, but the property ends up being rendered to the DOM.
Examples 🌈
Component usage:
Theme:
Motivation 🔦
The motivation is the same as the function
shouldForwardProp
that exists instyled
.Avoid rendering unnecessary properties to DOM.
The text was updated successfully, but these errors were encountered: