Reactjs React-Redux-Typescript:类型为';连接组件类';

Reactjs React-Redux-Typescript:类型为';连接组件类';,reactjs,typescript,redux,connect,Reactjs,Typescript,Redux,Connect,当我尝试使用connect方法将组件类连接到redux存储时,我遇到了一些问题。如果我删除这个连接方法,事情似乎很好 请指导我解决这个问题 组件代码: const mapDispatchToProps:MapDispatchToPropsFunction=( 派遣 ) => ({ changeDocumentState:(有效载荷)=>调度(changeDocumentState(有效载荷)), }); 常量MapStateTops:MapStateTops=( 州:AppState ):Re

当我尝试使用connect方法将组件类连接到redux存储时,我遇到了一些问题。如果我删除这个连接方法,事情似乎很好

请指导我解决这个问题

组件代码:

const mapDispatchToProps:MapDispatchToPropsFunction=(
派遣
) => ({
changeDocumentState:(有效载荷)=>调度(changeDocumentState(有效载荷)),
});
常量MapStateTops:MapStateTops=(
州:AppState
):ReduxProps=>({
用户:选择当前用户(状态),
});
//tslint:禁用下一行:无任何
export const InfoTable=with样式(样式,{withTheme:true})(
连接(MapStateTrops、mapDispatchToProps)(TableComponent)

);您可以减少以下类型:

const mapDispatchToProps  = {changeDocumentState} // If you just pass the function, it will behave just like your code above by wrapping the functions.
const mapStateToProps(
  state: AppState
) => ({
  user: selectCurrentUser(state), // Setting the type of the state is enough
});

export const InfoTable = withStyles(styles, { withTheme: true })(
  connect(mapStateToProps, mapDispatchToProps)(TableComponent)
);

请你分享代码,而不是代码编辑器的图片。刚刚添加的请看一看。谢谢回复。仍然面临同样的问题。即使我这样做了:export const InfoTable=withStyles(styles,{withTheme:true})(connect(null,null)(TableComponent));看起来你的类型不匹配。您能否共享应用程序状态的验证器类型以及将数据传递给的组件的类型。