Skip to content

Commit

Permalink
Allow react components in tagged template
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijesh Bittu committed Feb 7, 2025
1 parent 29a7d86 commit 77a085d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/pigment-css-react-new/src/styled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface CreateStyledComponent<
> {
<Props extends {} = {}>(
arg: TemplateStringsArray,
...templateArgs: (Primitive | ((props: Props) => Primitive))[]
...templateArgs: (StyledComponent<any> | Primitive | ((props: Props) => Primitive))[]
): StyledComponent<Substitute<OuterProps, Props>> & (Component extends string ? {} : Component);

<V extends {}>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('styled - runtime', () => {
});

const { getByTestId } = render(<StyledParent as="div" data-testid="component" />);
expect(getByTestId('component').className).to.equal('child');
expect(getByTestId('component').className).to.equal('child parent');
});

it('use component forward prop if provided `as` is a component', () => {
Expand Down

0 comments on commit 77a085d

Please sign in to comment.