-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[CardTitle] Unwanted warnings on CardTitle with actAsExpander #4761
Comments
I'm having this issue as well. Very annoying as we are trying to stomp out all react warnings. |
Same here ! material ui 0.15.2, chromium 51.0.2704.79, react 0.15.2 |
I'm using a temporary fix that seems to be working for the time being. To fix the error on CardText, for instance, open Change line 59 from this:
to this:
|
Would you do a PR with that ? EDIT: well, it actually doesn't really solve the problem, it's really temporary indeed |
From React documentation: So it should throw the warning but the custom attribute shouldn't get into the DOM during production mode. @arunkarottu: Removing the this.props not only gets rid of the custom DOM attributes but all of the valid DOM attributes except for the styles as well, which you might want to inject. As I see it, Material UI uses the property on the JS side but then we are injecting all props into the DOM, which is indeed not needed. A better temporary solution would be a tempObject, get rid of the Key since it isnt't doing anything and pass the tempObject to the DOM. I'll get into this tomorrow. |
okay, this did the job for me:
and
this solution still is kind of ugly but it is less intrusive |
It's just a solution to remove the warnings, and we have to do it manually for each props, i did that in CardTitle : function omit(currentProps) {
var propsCopy = Object.assign({}, currentProps);
['actAsExpander', 'showExpandableButton'].forEach(p => {
delete propsCopy[p]
})
return propsCopy;
} Still, it would be great to have a true fix |
this problem is linked to #4594 as well. |
Problem description
When using CardTitle as a card expander I get this React warning in the console:
And also on expandable CardText:
It works just fine though.
Steps to reproduce
Versions
The text was updated successfully, but these errors were encountered: