企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
**高阶组件是一个获取组件并返回新组件的函数。** ``` // React Redux's `connect` const ConnectedComment = connect(commentSelector, commentActions)(CommentList); 如果你把它分开,就会更容易看出发生了什么。 // connect is a function that returns another function const enhance = connect(commentListSelector, commentListActions); const ConnectedComment = enhance(CommentList); // The returned function is a HOC, which returns a component that is connected // to the Redux store ```