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

Carry styles from flattened components with withComponent #589

Merged
merged 2 commits into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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