todoList
todoList copied to clipboard
在React中使用Redux
How to write your own redux
该 demo 已被整合到 reactSPA, 在线展示。这个项目中对 redux 的使用作了一个比较完整的示范。
$ git clone https://github.com/MuYunyun/todoList.git
cd todoList
yarn
yarn start
redux 使用见分支 feature/redux
使用 React Hooks 替代 Redux
在 React 16.8 版本之后, 如果不是特别复杂
的业务场景, 可以使用 React 提供的 useContext、useReducer
实现自定义简化版的 redux, 可见该项目 master 分支。
特别复杂的场景暂时不建议使用此模式, 原因见 react-redux v7 回退到订阅的原因