-
Notifications
You must be signed in to change notification settings - Fork 309
Remove unknown props on <div> tag #759
Comments
Just came here to post this, thanks for taking care of it so fast @kylecesmat ! |
Quote from the related PR:
A short-term solution would be to make this prop a data attribute to silence the warning. This would render the attribute to the DOM, which is annoying, but that will happen anyway in React 16. Longer term... I'm not sure. We might think about a different mechanism for this behavior. Edit: Tried this out, and it is extremely noisy rendering a data attribute on every element in an app. Worst case we can do so, but we should try not to. /cc @ianobermiller |
Since Radium is using Babel, I was thinking about implementing a fix for this utilizing an ES2015 WeakMap to track which elements had already been processed (sidestepping need for DOM attributes), but that appears to not be allowed by the project configuration. @alexlande, is that an allowance to consider now or would that open a can of worms? |
@awkaiser: I like that idea, but we don't currently require any polyfills (beyond those required by React itself), and I'd like to keep it that way if we can. |
weakmap isn't an option because it cannot be polyfilled correctly. We'd have to manually keep track and somehow cleanup on |
Alright this is simplistic, but bear with me. Currently the only thing I didn't want to submit my PR if people were gonna blow up at the concept alone, so let me know if this is okay and if so I'll submit straightaway. |
@tquetano-r7: yeah, I floated that previously: #759 (comment) I don't particularly mind it, and if React 16 came out tomorrow and this was a breaking change we would probably do it. I'm hoping we can land on a different solution that doesn't result in a ton of extra attributes in the DOM, but worst case we'll use data attributes. |
ah sorry @alexlande i missed that comment. fair enough. |
How about |
Using a That said, based on the interest in this issue, it seems that the community feels more strongly about having to see the deprecation warning than I do, so maybe it's best that we add a data attribute for now and revisit after. |
This is fixed in |
@alexlande I'm still seeing this issue using <StyleRoot radiumConfig={{
userAgent: "..."
>
<div>Foo</div>
</StyleRoot>
|
Ah, thanks @doctyper. That one's an easy fix, at least. PR incoming! |
That's resolved in #787, for any digital archaeologists looking at this thread in the future. |
@alexlande, I'm still getting this Warning with the latest version of Radium:
Any ideas?
|
Me too. Still getting this warning. |
Reopening, I'll try to repro this. |
@alexlande, important to note, I experienced this when using a |
Ah, I see. Thanks for the update @russellr86. @romshiri, can you confirm that you're passing |
My bad, I was getting another warning, and it was my fault of using the StyleRoot in appropriately anyway. |
No problem, thanks for checking 👍 |
The
style-root
component is receiving all props passed to it. We should remove unused props asfuture versions of ReactReact v15.2.0 will throw warning messages.Line in question - https://github.com/FormidableLabs/radium/blob/master/src/components/style-root.js#L35
Related to this issue - react-bootstrap/react-bootstrap#1994 (comment)
The text was updated successfully, but these errors were encountered: