公司的项目还在用react15的写法。。。
现在有一个问题,
我的一个组件如下:
interface Props{
// ...
}
interface ReduxProps{
Zone:ZonState
dispatch:Dispatch<any>
}
interface State{
// ...
}
interface Item{
props:Props & ReduxProps;
state:State
}
@connect(
({ Zone }) => ({ Zone }),
(dispatch) => ({ dispatch }),
)
class Item extends React.Component{
// ...
}
export default Item;
但是在父组件中报错:
我现在的做法是用一个中间变量来协作替换,但是太麻烦了:
import { ComponentClass } from 'react';
// ...
const Index: ComponentClass<Props> = Item;
export default Index;
我该如何导出组件才能不会报错呢