Learning Redux
上QQ阅读APP看书,第一时间看更新

Setting up React

Before learning how to use Redux with React, we should first get familiar with React itself. We are going to use the project template (the first code example) from Chapter 2, Implementing the Elements of Redux.

Firstly, we have to install React and ReactDOM via npm:

npm install --save react react-dom

React is the core library, which deals with user interface components.

ReactDOM renders React components to the DOM, which, in this case, means that HTML will get rendered in the browser.

There are also other renderers for React, such as React Native. It allows you to render your application to native mobile apps, such as Android and iOS. You can find more information at https://facebook.github.io/react-native/.