Пытаюсь настроить коннект к стору, тайпскрипт постоянно ругается на эту строчку
const mapStateToProps = (state: any) => {
return { unreadMessages: state.unreadMessages };
}
const mapDispatchToProps = dispatch => {
return {
addMsgAction: msg => dispatch(addMessage(msg))
}
}
@connect(mapStateToProps, mapDispatchToProps)
// ругается на @connect -
//Error:(28, 2) TS2345: Argument of type 'typeof MainLayout' is not assignable to parameter of type
//'Component<any, {}, any>'.
// Property 'setState' is missing in type 'typeof MainLayout'.
export class MainLayout extends React.Component <IMainLayoutProps, IState> {
constructor(props, context) {
super(props, context);
}
public componentDidMount() {
}
public render() {
const { children, match: { params } } = this.props;
return (
<div className={style.layout}>
<Header page={params.page}/>
<div className={style.page}>
{children}
</div>
<Footer/>
</div>
);
}
}