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

taneba
Copy link
Contributor

@taneba 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.

ghost
ghost previously approved these changes Jan 31, 2019
Copy link
Member

@mxstbr 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 taneba dismissed ghost ’s stale review via dee5708 Feb 1, 2019
@taneba
Copy link
Contributor Author

@taneba taneba commented Feb 1, 2019

Updated! Thanks @mxstbr for taking a look!

@ghost
Copy link

@ghost ghost commented Feb 8, 2019

Is there a next step on this?

@taneba
Copy link
Contributor Author

@taneba 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)) {
Copy link
Contributor

@probablyup probablyup Feb 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

@taneba taneba Feb 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, done!

Copy link
Contributor

@probablyup probablyup left a comment

Thanks!

@probablyup probablyup merged commit 822d9c9 into styled-components:master Mar 21, 2019
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants