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 props on composed components #236

Merged
merged 2 commits into from
Aug 5, 2017

Conversation

emmatown
Copy link
Member

@emmatown emmatown commented Aug 5, 2017

What:

Filter props on components that are styled components that have string tags. For example the props on Link will now be filtered.

const BaseLink = styled.a`background-color: hotpink;`
const Link = styled(BaseLink)`color: green;`

Why:

Because otherwise there will be unknown prop warnings on composed styled components.

How:

Move the declaration of spec to be before Styled is defined and check wether the first spec's tag is a string instead of just the tag.

Checklist:

  • Documentation N/A
  • Tests
  • Code complete

This is also a bit smaller now. 🎉

@codecov-io
Copy link

codecov-io commented Aug 5, 2017

Codecov Report

Merging #236 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
- Coverage   90.31%   90.26%   -0.06%     
==========================================
  Files          20       20              
  Lines         971      966       -5     
  Branches      263      261       -2     
==========================================
- Hits          877      872       -5     
  Misses         76       76              
  Partials       18       18
Impacted Files Coverage Δ
src/react/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3a5a66...30a4bb1. Read the comment docs.

@tkh44
Copy link
Member

tkh44 commented Aug 5, 2017

This should fix factories as well! Awesome work.

@tkh44 tkh44 merged commit 9a3cbcd into master Aug 5, 2017
@tkh44 tkh44 deleted the filter-props-on-composed-components-2 branch August 5, 2017 15:48
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