@acemarke/react-redux 中文文档教程
React Redux
Redux 的官方 React 绑定。
高性能且灵活。
Installation
React Redux 需要 React 16.4 或更高版本。
npm install --save react-redux
这假设您使用的是 npm 包管理器 使用像 Webpack 这样的模块打包器或者 Browserify 以使用 CommonJS 模块。
如果您还没有使用 npm 或现代模块捆绑器,并且更喜欢单个文件 UMD 构建使 ReactRedux
可用作全局对象,您可以从 cdnjs。 我们不建议任何严肃的应用程序使用这种方法,因为大多数与 Redux 互补的库仅在 npm。
React Native
从 React Native 0.18 开始,React Redux 5.x 应该可以与 React Native 一起使用。 如果您对 React Native 上的 React Redux 5.x 有任何问题,请运行 npm ls react
并确保您的 node_modules
中没有重复的 React 安装。 我们建议您使用 npm@3.x
可以更好地避免此类问题。
如果您使用的是旧版本的 React Native,则需要继续使用 React Redux 3.x 分支和文档因为这个问题。
Documentation
React Redux 文档现已发布在 https://react-redux.js.org 上。
我们目前正在扩展和重写我们的文档内容 - 请稍后回来查看更多更新!
How Does It Work?
我们在本期阅读资源中深入探讨了 React Redux 的工作原理。
享受!
License
麻省理工学院
React Redux
Official React bindings for Redux.
Performant and flexible.
Installation
React Redux requires React 16.4 or later.
npm install --save react-redux
This assumes that you’re using npm package manager with a module bundler like Webpack or Browserify to consume CommonJS modules.
If you don’t yet use npm or a modern module bundler, and would rather prefer a single-file UMD build that makes ReactRedux
available as a global object, you can grab a pre-built version from cdnjs. We don’t recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on npm.
React Native
As of React Native 0.18, React Redux 5.x should work with React Native. If you have any issues with React Redux 5.x on React Native, run npm ls react
and make sure you don’t have a duplicate React installation in your node_modules
. We recommend that you use npm@3.x
which is better at avoiding these kinds of issues.
If you are on an older version of React Native, you’ll need to keep using React Redux 3.x branch and documentation because of this problem.
Documentation
The React Redux docs are now published at https://react-redux.js.org .
We're currently expanding and rewriting our docs content - check back soon for more updates!
How Does It Work?
We do a deep dive on how React Redux works in this readthesource episode.
Enjoy!
License
MIT