![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
不科学的年轻人
这个作者很懒,什么都没留下…
展开
-
react-router-dom学习心得1.0
通过 react-router-dom 实现路由的简单例子官网文档 https://reacttraining.com/react-router/web/example/basicindex.jsimport React,{Component} from "react"; import {render} from "react-dom"; import {BrowserRouter,Route,L...原创 2018-04-03 16:51:59 · 196 阅读 · 0 评论 -
react-router-dom学习心得2.0
一般来说路由都是要提取出来,是结构清晰文件目录如下【注意以下文件均在src目录下】components>about>index.jsimport React,{Component} from "react"; class About extends Component{ render(){ return( <h1>this ...原创 2018-04-03 17:29:16 · 248 阅读 · 0 评论 -
redux入门
const ADD = 'increment'; const SUB = 'decrement'; //reducer export function counter(state=0,action){ switch(action.type){ case ADD: return state+1; case SUB: ...原创 2018-04-04 16:21:53 · 111 阅读 · 0 评论 -
redux和react结合使用
把reducer函数抽离出来到 ./store/index.redux.jsconst ADD_GUN = "加机关枪";//为了后期代码复用 const SUB_GUN = "减机关枪"; export function counter(state=0, action){ switch(action.type){ case ADD_GUN: re...原创 2018-04-06 16:14:18 · 207 阅读 · 0 评论