We will learn how to use withRouter() to inject params provided by React Router into connected components deep in the tree without passing them down all the way down as props. The app component itself does not really use filter. It just passes the fi…
Root Smart component can be overloaded, divide 'smart' component wisely & using Provider. Problem: Something the root component can be overloaded, means it handle too many application logics. For a larger application, it will be hard to maintain. Sol…
Redux 原理 1. 单一数据源 all states ==>Store 随着组件的复杂度上升(包括交互逻辑和业务逻辑),数据来源逐渐混乱,导致组件内部数据调用十分复杂,会产生数据冗余或者混用等情况. Store 的基本思想是将所有的数据集中管理,数据通过 Store 分类处理更新,不再在组件内放养式生长. 2. 单向数据流 dispatch(actionCreator) => Reducer => (state, action) => state 单向数据流保证了数据的变化是有…
React-router is the community favourite routing solution - it can handle all of your complex routing needs and in this lesson we’ll cover what’s needed to enable it’s use within Preact. https://github.com/ReactTraining/react-router in webpack.config.…