一、回顾组件传递以及 Redux 介绍;
1、官网介绍
-
http://www.ruanyifeng.com/blog/2016/09/redux_tutorial_part_one_basic_usages.html
-
http://cn.redux.js.org/index.html;
2、react中状态数据state的传递
-
父子组件之间可以传递数据:props、回传事件;
-
使用Redux使用场景:兄弟之间组件传递数据,共同的子元素或者共同的父元素(大量的组件需要视同同一条数据);

// App.jsx
import React from 'react';
import Parent from "./components/coms/Parent"
class App extends React.Component {
render(){
return (
本文介绍了React中使用Redux进行状态管理,包括组件间数据传递、Bootsrap通过CDN加载、Redux核心概念如mapStateToProps和mapDispatchToProps,以及如何使用dipatch、bindActionCreators和combineReducers。还探讨了Redux的异步中间件redux-thunk及其应用场景和调试工具的使用。
订阅专栏 解锁全文
940

被折叠的 条评论
为什么被折叠?



