react-redux ,Provider 内的任何一个组件 都需要connect来包装

Provider 内的任何一个组件(比如这里的 Comp),如果需要使用 state 中的数据,就必须是「被 connect 过的」组件——使用 connect 方法对「你编写的组件(MyComp)」进行包装后的产物。

posted @ 2020-09-21 10:14  cnchengv  阅读(9)  评论(0编辑  收藏  举报