從零開始建立一個React項目

本文章是經過項目實踐一步一步寫的記錄
項目地址:https://github.com/livaha/react-cms
複製代碼

1、建立一個項目

  • 首先建立一個文件夾,這裏名爲react-csm,打開終端輸入
> create-react-app react-csm
  > cd react-csm
  > yarn start 
複製代碼

首次啓動的項目長這樣,react版本又升級了!:html

commit id :5f0b031react

2、引入antd並制定主題

參考文章: react 引入antd並制定主題git

commit id:3a358a9github

3、經過redux搭建路由

1 先構建一下項目結構json

├── README.md
├── package.json
├── public
│   ├── favicon.ico
│   └── index.html
├── src
│   ├── components
│   ├── layouts
│   ├── redux
│   ├── routes
│   ├── views
│   └── index.js
└── yarn.lock

複製代碼

2 安裝redux相關庫redux

yarn add react-redux react-router-redux
複製代碼

項目地址:github.com/livaha/reac…bash

喜歡請給個星哦antd

相關文章
相關標籤/搜索