当前位置: 首页> 健康> 科研 > 关于redux的一点记录

关于redux的一点记录

时间:2025/7/11 9:24:53来源:https://blog.csdn.net/m0_73669127/article/details/141729698 浏览次数:0次

关于redux的一点记录

文字记录
  1. state进入provide,也就进入组件树
  2. state 被mapStateToProps转换了,然后mapDispathToProps也转换了用dispatch实现的一些action
  3. 再用connect把组合的props传入container
  4. 使用 connect 并通过 mapDispatchToProps 映射 action 创建器时,react-redux 会自动绑定 dispatch 方法。这意味着可以直接在组件中调用这些 action 创建器,而不需要显式地调用 dispatch

一些概念的关系

t y p e ⇒ a c t i o n a c t i o n + d i s p a t c h ⇒ d y n a m i c a c t i o n d y n a m i c a c t i o n + s t a t e ⇒ p r o p s 1 + p r o p s 2 ⇒ p r o p s a c t i o n ⇔ ( d y n a m i c ) a c t i o n \begin {align*} &type \Rightarrow action\\ &action + dispatch \Rightarrow dynamic \;action\\ &dynamic \; action + state \Rightarrow props1 + props2 \Rightarrow props\\ &action \; \Leftrightarrow (dynamic) \; action \end{align*} typeactionaction+dispatchdynamicactiondynamicaction+stateprops1+props2propsaction(dynamic)action

关键字:关于redux的一点记录

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: