diff --git a/packages/react/src/styled.tsx b/packages/react/src/styled.tsx index 91922746c..9fe77a837 100644 --- a/packages/react/src/styled.tsx +++ b/packages/react/src/styled.tsx @@ -10,6 +10,7 @@ import type { ITheme, ExtendedConfigType, IComponentStyleConfig, + StyledConfig, } from './types'; import { deepMerge, @@ -978,7 +979,7 @@ export function verboseStyled( componentStyleConfig?.descendantStyle && componentStyleConfig?.descendantStyle?.length > 0; - const NewComp = ( + const StyledComponent = ( { children, //@ts-ignore @@ -1892,7 +1893,7 @@ export function verboseStyled( return component; }; - const StyledComp = React.forwardRef(NewComp); + const StyledComp = React.forwardRef(StyledComponent); const displayName = componentStyleConfig?.componentName ? componentStyleConfig?.componentName @@ -1905,7 +1906,7 @@ export function verboseStyled( //@ts-ignore StyledComp.isStyledComponent = true; - return StyledComp; + return StyledComp as typeof StyledComp & { styledConfig?: StyledConfig }; } export function styled( diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index 4614ce1cf..47301963f 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -959,3 +959,5 @@ export type ExtendedTheme = ITheme< export type CreateComponents = { [key in keyof T]: T[key]; }; + +export type StyledConfig = any;