配置react, redux, next.js环境

react

1. react

https://reactjs.org/docs/add-react-to-a-new-app.html

npm install -g create-react-app

create-react-app my-app

cd my-app

npm start

styling:

https://codeburst.io/4-four-ways-to-style-react-components-ac6f323da822

2.redux

https://github.com/reactjs/redux

npm install --save redux

//Complementary Packages

npm install --save react-redux

npm install --save-dev redux-devtools

 react-redux

https://github.com/reactjs/react-redux

npm install --save react-redux

中文文档:

http://cn.redux.js.org/

3. webpack

npm install -g webpack

4. babel-loader

npm install babel-loader babel-core babel-preset-env webpack

5. next

https://github.com/zeit/next.js/

npm install --save next react react-dom

and add a script to your package.json like this:

{

"scripts": {

"dev": "next",

"build": "next build",

"start": "next start"

}

}

next.js + css:

npm install --save @zeit/next-css

6. cookie

https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie

npm install universal-cookie

7. axios

https://github.com/axios/axios

npm install axios

8. redux-thunk

https://github.com/gaearon/redux-thunk

npm install --save redux-thunk

按照next-app的方式:

https://medium.com/front-end-hacking/next-js-redux-integration-3ab1a9ca5e1d

以上是 配置react, redux, next.js环境 的全部内容, 来源链接: utcz.com/z/381151.html

回到顶部