![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
twcmeizi
这个作者很懒,什么都没留下…
展开
-
react笔记四:你可能不需要使用派生 state(解读--个人)
react派生state的学习原创 2022-09-05 14:51:32 · 464 阅读 · 1 评论 -
redux搭配react-redux实现简易购物车
1.创建reducer eg:./shopcarList/shopCarList.js const initState = [ //初始状态 { id: 1, name: "apple", allnum: 10, num: 0, remainnum:10, price: 5 }, { id: 2, name: "apple2", alln原创 2022-04-06 14:40:59 · 556 阅读 · 0 评论 -
redux的bindActionCreators理解
actionCreators export function addTodo(text) { return { type: 'ADD_TODO', text } } export function removeTodo(id) { return { type: 'REMOVE_TODO', id } } 得到的对象为: { addTodo : text => { type: 'ADD_TODO', text原创 2022-04-06 14:36:59 · 156 阅读 · 0 评论 -
react hooks的应用&&react-router-dom hooks的应用
react hooks的应用 useContext(context) import React, { useContext } from 'react' const bgcolor = { bgf: {background: "red"}, bgs: {background: "blue"} } const themeContext = React.createContext(bgcolor.bgf);//创建以bgcolor.bgf为默认值context上下文 export defaul原创 2022-04-06 14:24:39 · 297 阅读 · 0 评论 -
react实现文字验证,图片验证功能
文字登录注册验证 图片登录注册验证原创 2021-12-16 17:26:30 · 1541 阅读 · 0 评论 -
react笔记一:使用ref、高阶函数复用、函数回调来获取表单输入的数据
过时的ref import React from 'react'; class login extends React.Component { constructor(props) { super(props); this.state = { name: '', password: "", } this.refsname=React.createRef();原创 2021-11-18 17:56:44 · 902 阅读 · 0 评论