美文网首页
搭建一个React-redux-router + antd项目(

搭建一个React-redux-router + antd项目(

作者: 子尐小太爷 | 来源:发表于2019-08-19 14:01 被阅读0次

直接进入正题。
先用brew安装 Node(点此自行安装Homebrew)。

brew install node

安装淘宝镜像,网速自信的可以跳过此步

npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global

建议安装yarn,当然是用npm完全没问题。不需要的直接跳过接下来的两步

npm install -g yarn

安装完yarn也最好设置镜像

yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global

初始化create-react-app,cd到自己的项目路径下:

npm install create-react-app yarn -g    // 使用yarn安装 create-react-app
npm isntall -g create-react-app         // 也可以使用npm直接安装
create-react-app --version              // 查看create-react-app版本
create-react-app my-app                 // 用create-react-app 创建一个名叫my-app项目

这时候已经创建好一个叫 my-app 的项目了。(也可以使用npx直接创建)

npx create-react-app my-app

注意这里的 npx 并非拼写错误,它是npm 5.2以上版本附带的一个包运行器工具。

安装好以后 start 就可以看到一个react 项目

cd my-app 
yran start     // 或npm start 

搭建一个React-redux-router + antd项目(二)安装 redux、router、axios和antd
搭建一个React-redux-router + antd项目(三)使用路由
搭建一个React-redux-router + antd项目(四)redux初始
搭建一个React-redux-router + antd项目(五)用action更新store
搭建一个React-redux-router + antd项目(六)用 redux-persist 实现数据持久化

相关文章

网友评论

      本文标题:搭建一个React-redux-router + antd项目(

      本文链接:https://www.haomeiwen.com/subject/pzsgjctx.html