我有这个更高阶的组件,它接收前一个志愿者的补偿和一个操作,然后呈现一个包含志愿者信息的表格:\n志愿者补偿代码:
\nclass Volenteer extends Component {\n render() {\n const title = \'\xd7\xa8\xd7\xa9\xd7\x99\xd7\x9e\xd7\xaa \xd7\x9e\xd7\xaa\xd7\xa0\xd7\x93\xd7\x91\xd7\x99\xd7\x9d\';\n const mode = \'work\';\n return (\n <EntityTable \n columns = {columns}\n title = {title}\n mode = {mode}\n promiseProps = {this.props}\n />\n )\n }\n}\n\nexport default WithEntity(Volenteer, requestVolunteerData() );\nRun Code Online (Sandbox Code Playgroud)\nHOC代码是:
\nimport React, {Component} from \'react\';\nimport { connect } from \'react-redux\';\n\nconst WithEntity = (EntityComponent, action) => {\n\n const mapStateToProps = state => {\n return {\n isPending: state.requestEntitiesReducer.isPending,\n entities: state.requestEntitiesReducer.entities,\n error: state.requestEntitiesReducer.error\n }\n }\n \n const mapDispatchToProps = …Run Code Online (Sandbox Code Playgroud)