Skip to content

Commit

Permalink
fix(style): don't overwrite original value
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz committed May 5, 2022
1 parent 8898fee commit 752dee4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/styl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type Styles<P> = StylesWithTheme<P> | StyleProperties
*/
type DefaultProps = object & {
as?: ComponentType<any>
style?: StyleProp<StyleProperties>
children?: ReactNode
}

Expand Down Expand Up @@ -146,7 +145,9 @@ const styl = <Comp extends ComponentType<any>>(Component: Comp) => <
const { theme } = useContext(Context)

// Spread props and inline styles
const { style: inlineStyles = {}, as, ...restProps } = props
const { style: inlineStyles = {}, as, ...restProps } = props as Props & {
style: StyleProp<StyleProperties>
}

// Check type of argument
const styles =
Expand Down

0 comments on commit 752dee4

Please sign in to comment.