Skip to content
This repository was archived by the owner on Jun 20, 2022. It is now read-only.

Commit f8e45cc

Browse files
committed
fix(sc): fix withComponent + styled behaviour
1 parent 77872db commit f8e45cc

File tree

1 file changed

+1
-5
lines changed
  • packages/shared/core/styled-engine

1 file changed

+1
-5
lines changed

packages/shared/core/styled-engine/util.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ function patchStyledComponent(StyledComponent) {
99
const { render, withComponent: baseWithComponent } = StyledComponent
1010

1111
StyledComponent.withComponent = (component, ...args) => {
12-
const { defaultProps, propTypes } = StyledComponent
1312
const Target = StyledComponent.target
1413
const NewTarget = props => <Target as={component} {...props} />
1514
// eslint-disable-next-line no-underscore-dangle
1615
NewTarget.__smoothUIComponent = true
1716
return patchStyledComponent(
18-
Object.assign(baseWithComponent(NewTarget, ...args), {
19-
defaultProps,
20-
propTypes,
21-
}),
17+
Object.assign(baseWithComponent(NewTarget, ...args), StyledComponent),
2218
)
2319
}
2420

0 commit comments

Comments
 (0)