Skip to content

Commit 77a085d

Browse files
author
Brijesh Bittu
committed
Allow react components in tagged template
1 parent 29a7d86 commit 77a085d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/pigment-css-react-new/src/styled.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export interface CreateStyledComponent<
4646
> {
4747
<Props extends {} = {}>(
4848
arg: TemplateStringsArray,
49-
...templateArgs: (Primitive | ((props: Props) => Primitive))[]
49+
...templateArgs: (StyledComponent<any> | Primitive | ((props: Props) => Primitive))[]
5050
): StyledComponent<Substitute<OuterProps, Props>> & (Component extends string ? {} : Component);
5151

5252
<V extends {}>(

packages/pigment-css-react-new/tests/styled/styled-runtime.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('styled - runtime', () => {
149149
});
150150

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

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

0 commit comments

Comments
 (0)