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

Fix get styled className from children components #313

Merged
merged 2 commits into from Apr 14, 2020
Merged

Fix get styled className from children components #313

merged 2 commits into from Apr 14, 2020

Conversation

ghost
Copy link

@ghost ghost commented Apr 14, 2020

Fix issue introduced in #309, the .find is broken when try to
get/check styles in children components if the component have another className.

e.g.

  const ParentComponent = (props) => (
    <MyStyledComponent {...props}>
      <Children className="test-class" /> //--> it don't get styled class
      <Children /> //--> it get styled class
    </MyStyledComponent>
  );

also in mount for parent

<MyStyledComponent className="test-class" />

Also node.props("className").className is not necessary and redundant coz node.prop("className"); return the same in mount/shallow

Camilo QS added 2 commits April 13, 2020 20:49
Fix issue introduced in #309, the .find is broken when try to
get/check styles in children components.
@quantizor quantizor merged commit f8e6f79 into styled-components:master Apr 14, 2020
@ghost ghost deleted the fix-mount-not-get-styles branch April 14, 2020 13:59
@ghost ghost mentioned this pull request Jun 10, 2020
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.

None yet

1 participant