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

[styled-components v4] Various small improvements to the libdefs #3731

Merged
merged 2 commits into from
Feb 14, 2020
Merged

[styled-components v4] Various small improvements to the libdefs #3731

merged 2 commits into from
Feb 14, 2020

Conversation

omninonsense
Copy link
Contributor

@omninonsense omninonsense commented Feb 13, 2020

Changes:

  1. The return value of StyleSheetManager.prototype.render
  2. All styled components implicitly support style, className, and children, so reflect that.
    People can still override them if they need to (e.g. wanting to narrow children with children?: React.ChildrenArray<…>) using Props.

Note: One big "breaking change" is that strict props are no longer "respected" on components. So, it won't catch typos any longer. This now more aligns with flow's new "only error if there's a runtime error" paradigm (unless I am wrong and this does cause runtime errors, but extra props shouldn't cause runtime errors).

Making it a draft while I still test some of this against our production codebase at work, too. The tests seem to be happy and this seems to work on one of our smaller projects. So, hopefully won't stay a draft for too long!

Also, this should probably be merged after #3667.

@omninonsense
Copy link
Contributor Author

Fixed the CI error. Other CI errors are because of older styled-component libraries.

@omninonsense
Copy link
Contributor Author

Ok in our larger codebase there was some issues with style being defined on one component in a weird way, but that was the only problem. So I guess this is ready for review.

@omninonsense omninonsense marked this pull request as ready for review February 13, 2020 14:55
Copy link
Contributor

@AndrewSouthpaw AndrewSouthpaw left a comment

Choose a reason for hiding this comment

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

LGTM. Travis errors seem to be related to older versions that are running their tests for some reason, so I'm going to merge this in. Thanks!

@AndrewSouthpaw AndrewSouthpaw merged commit bc582bb into flow-typed:master Feb 14, 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

2 participants