Skip to content

Commit

Permalink
fix(react): fixed types for supporting class components (fixes #730) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Anber authored Nov 29, 2021
1 parent 091cf53 commit e637ecb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ interface IProps {
}

// If styled wraps custom component, that component should have className property
function styled<TConstructor extends React.FunctionComponent<any>>(
tag: TConstructor extends React.FunctionComponent<infer T>
function styled<TConstructor extends React.ComponentType<any>>(
tag: TConstructor extends React.ComponentType<infer T>
? [T] extends [{ className?: string | undefined }]
? TConstructor
: never
Expand Down

0 comments on commit e637ecb

Please sign in to comment.