Skip to content

Commit

Permalink
Carry styles from flattened components with withComponent (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Mar 6, 2018
1 parent 5e23a73 commit f88f228
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/create-emotion-styled/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function createEmotionStyled(emotion: Emotion, view: ReactType) {
? // $FlowFixMe
omitAssign(testAlwaysTrue, {}, options, nextOptions)
: options
)(...args)
)(...styles)
}

return Styled
Expand Down
3 changes: 2 additions & 1 deletion packages/react-emotion/test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,9 @@ exports[`styled with higher order component that hoists statics 1`] = `
/>
`;

exports[`styled withComponent does not carry styles from flattened component 1`] = `
exports[`styled withComponent carries styles from flattened components 1`] = `
.emotion-0 {
color: green;
color: hotpink;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-emotion/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ describe('styled', () => {
.toJSON()
expect(tree).toMatchSnapshot()
})
test('withComponent does not carry styles from flattened component', () => {
test('withComponent carries styles from flattened components', () => {
const SomeComponent = styled.div`
color: green;
`
Expand Down

0 comments on commit f88f228

Please sign in to comment.