我正在为React / Redux项目设置TypeScript。
遵循标准的Redux模式,我有一个Component Foo和一个ComponentContainer FooContainer。
// Foo Component file
interface FooProps {
fooProp: string <-- I think props have something to do with the issue
}
class Foo extends React.Component<FooProps, {}> {
...
}
// in FooContainer file
...
const FooContainer =
connect(mapStateToProps,mapDispatchToProps)(Foo <--)
// Foo throws TypeScript error
// Argument of type 'typeof Foo' is not assignable
// to parameter of type 'ComponentClass