You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v4 passes through unknown HTML attribute to the DOM #2131
What's interesting is that [email protected] works much the same but instead of camelCase props are inserted in lowercase and React doesn't warn about this.
Warning: React does not recognize the linkStyle prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase linkstyle instead. If you accidentally passed it from a parent component, remove it from the DOM element.
Is this related to an existing issue or should I open a new issue?
Reacted by Brantley English, ryanf5, Jarod Taylor, Sergey S. Volkov, Dominik Krzywiecki and Olivier Tassinari
@mbrowne Since Link is a custom component, we don't do prop filtering and pass all props through to it. Until we settle on one of the several prop handling proposals floating around for v5 I don't think we're going to have a good solution for this.
Any update on this now that v5 beta is out? I'm attempting to use Formik's Field component with styled-components and want to customize the css if an error is present or not.
On Jan 15, 2020, at 5:59 AM, GuilleDF ***@***.***> wrote:
Seeing as this still happens in v5 for custom components, can we reopen this issue? Or create a new one?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Activity
Fer0x commentedon Oct 20, 2018
Don't think that it is expected behavior.
Also example from docs https://www.styled-components.com/docs/basics#attaching-additional-props works in similar way:
mxstbr commentedon Oct 21, 2018
This is definitely a bug, any ideas why this broke @probablyup?
Fer0x commentedon Oct 21, 2018
@shiningjason @mxstbr
What's interesting is that [email protected] works much the same but instead of camelCase props are inserted in lowercase and React doesn't warn about this.
mxstbr commentedon Oct 21, 2018
Oh, that's even more strange 🤔
Fer0x commentedon Oct 27, 2018
Fixed in #2133
However, pay attention to #2093. It will add new way to tell which attributes should pass as html attributes
mbrowne commentedon Nov 21, 2018
I'm seeing a similar issue with the new
asprop, e.g.:Is this related to an existing issue or should I open a new issue?
quantizor commentedon Nov 23, 2018
@mbrowne Since
Linkis a custom component, we don't do prop filtering and pass all props through to it. Until we settle on one of the several prop handling proposals floating around for v5 I don't think we're going to have a good solution for this.byzyk commentedon Mar 14, 2019
Is there any ETA on when this can be addressed? Or let me know if I can help with the PR and what the challenge is.
byzyk commentedon Mar 14, 2019
As a workaround for eliminating React warnings in custom components, I had to make use of
data-*attributes.jarodtaylor commentedon Aug 16, 2019
Will this be resolved in v5 for the
Link(or any other custom components)?TerrorOnMtHyjal commentedon Nov 20, 2019
Any update on this now that v5 beta is out? I'm attempting to use Formik's Field component with styled-components and want to customize the css if an error is present or not.
srikanthbhamidipalli commentedon Dec 27, 2019
Still I'm getting error.. 😢
GuilleDF commentedon Jan 15, 2020
Seeing as this still happens in v5 for custom components, can we reopen this issue? Or create a new one?
quantizor commentedon Jan 15, 2020
ItsMrAkhil commentedon Feb 3, 2020
@probablyup @mxstbr Why can't we filter properties based on some prefix like
$, like below?<StyledComp $someStyleProp={someValue} />The
$someStylePropwill not be passed down as the user explicitly wants to ignore the property being passed down?quantizor commentedon Feb 3, 2020
Maushundb commentedon Feb 4, 2020
The top answer here solved it for me