Skip to content

Commit

Permalink
fix: type CreateStyledComponent to accept string and object (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
FourwingsY authored Dec 27, 2024
1 parent a538810 commit 9989784
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/pigment-css-react/src/styled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ export interface CreateStyledComponent<
Component extends React.ElementType,
OuterProps extends object,
> {
// Template Literal case
(
styles: TemplateStringsArray,
...args: Array<((options: ThemeArgs) => Primitve) | Primitve | React.ComponentClass>
...args: Array<
| ((options: ThemeArgs) => Primitve)
| Primitve
| React.ComponentClass
| StyledArgument<OuterProps>
>
): StyledComponent<OuterProps> & (Component extends string ? BaseDefaultProps : Component);

/**
Expand Down

0 comments on commit 9989784

Please sign in to comment.