Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj authored and Suraj committed Sep 27, 2023
1 parent e82c2a7 commit 3ff26f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/react/src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
ITheme,
ExtendedConfigType,
IComponentStyleConfig,
StyledConfig,
} from './types';
import {
deepMerge,
Expand Down Expand Up @@ -978,7 +979,7 @@ export function verboseStyled<P, Variants, ComCon>(
componentStyleConfig?.descendantStyle &&
componentStyleConfig?.descendantStyle?.length > 0;

const NewComp = (
const StyledComponent = (
{
children,
//@ts-ignore
Expand Down Expand Up @@ -1892,7 +1893,7 @@ export function verboseStyled<P, Variants, ComCon>(
return component;
};

const StyledComp = React.forwardRef(NewComp);
const StyledComp = React.forwardRef(StyledComponent);

const displayName = componentStyleConfig?.componentName
? componentStyleConfig?.componentName
Expand All @@ -1905,7 +1906,7 @@ export function verboseStyled<P, Variants, ComCon>(
//@ts-ignore
StyledComp.isStyledComponent = true;

return StyledComp;
return StyledComp as typeof StyledComp & { styledConfig?: StyledConfig };
}

export function styled<P, Variants, ComCon>(
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,3 +959,5 @@ export type ExtendedTheme<Variants> = ITheme<
export type CreateComponents<T> = {
[key in keyof T]: T[key];
};

export type StyledConfig = any;

0 comments on commit 3ff26f9

Please sign in to comment.