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

Filter suppressClassNameWarning to not to pass down to wrapped components #2365

Conversation

Projects
None yet
4 participants
@taneba
Copy link
Contributor

taneba commented Jan 31, 2019

fixes #2346

Once I tried the solution that @leantide mentioned in the related issue, but it didn't work (I think it is because React likely freezes props).
What I did Instead is to filter suppressClassNameWarning when passing props to child component.

@mxstbr
Copy link
Member

mxstbr left a comment

Looking great, thanks so much!

Would you mind adding an entry in CHANGELOG.md please? Then we can merge this. Thank you 🙏

@taneba

This comment has been minimized.

Copy link
Contributor Author

taneba commented Feb 1, 2019

Updated! Thanks @mxstbr for taking a look!

@leantide

This comment has been minimized.

Copy link

leantide commented Feb 8, 2019

Is there a next step on this?

@taneba

This comment has been minimized.

Copy link
Contributor Author

taneba commented Feb 9, 2019

I'm not sure.
@mxstbr Is there anything left to do?

@@ -147,7 +147,7 @@ class StyledComponent extends Component<*> {

if (key === 'forwardedComponent' || key === 'as') continue;
else if (key === 'forwardedRef') propsForElement.ref = computedProps[key];
else if (!isTargetTag || validAttr(key)) {
else if ((!isTargetTag && key !== 'suppressClassNameWarning') || validAttr(key)) {

This comment has been minimized.

Copy link
@probablyup

probablyup Feb 17, 2019

Contributor

can you move this up to L148 where forwardedComponent and as are? It can just be skipped along with those known props

This comment has been minimized.

Copy link
@taneba

taneba Feb 18, 2019

Author Contributor

good point, done!

@probablyup
Copy link
Contributor

probablyup left a comment

Thanks!

@probablyup probablyup merged commit 822d9c9 into styled-components:master Mar 21, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.