https://github.com/yuthelloworld/react-router-demo
🐛 Simple react-router demos
https://github.com/yuthelloworld/react-router-demo
Last synced: 16 days ago
JSON representation
🐛 Simple react-router demos
- Host: GitHub
- URL: https://github.com/yuthelloworld/react-router-demo
- Owner: YutHelloWorld
- Created: 2017-07-17T07:31:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-10T08:30:56.000Z (over 8 years ago)
- Last Synced: 2025-03-01T06:25:40.445Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-router-demo
这是一个入门React-Router的小巧Demo。这个demo里尽量不会为你带来新的所需知识。
## 安装
### 克隆
```bash
$ git clone https://github.com/yuthelloworld/react-router-demo.git
$ cd
```
### 安装依赖
```bash
$ npm install
```
## 运行
```bash
npm start
```
## 浏览器查看
浏览器输入 http://localhost:8080/
## 切换示例
以切换 redirectAuth示例为例
- 编辑`webpack.config.js`
```JS
module.exports = {
entry: './index.js',
//修改为
module.exports = {
entry: './redirectAuth.js',
```
- 运行`npm start`
## 可以学到什么?
- React pure function(stateless component)
- webpack的简单配置和使用webpack-dev-server启动一个热更新的http-server
- React-Router的几个概念和简单应用