• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ArgenBarbie
博客园    首页    新随笔    联系   管理    订阅  订阅
配置react, redux, next.js环境

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

posted on 2018-05-03 15:57  ArgenBarbie  阅读(359)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3