Styled Components with Typescript return type is any

Viewed 786

I have a component like:

class Foo extends React.Component<SkeletonProps, any> { ... }

When I use this with styled-components like:

const StyledFoo = styled(Foo)`height: 100px`

The type of StyledFoo is any (i.e no specific prop types), how can I make StyledFoo keep the SkeletonProps as its props?

2 Answers

Installing the 3rd version of hoist-non-react-statics worked for me.

npm add hoist-non-react-statics@3
Related