上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页
摘要: 视频: https://www.bilibili.com/video/BV1x54y1B7RE?from=search&seid=10948197841954912425 比较好的博客: https://blog.csdn.net/dangnian/article/details/50876241? 阅读全文
posted @ 2021-02-12 22:46 程序员草莓 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 1 react源码分析的面试题: https://www.bilibili.com/video/BV16t4y1r7oJ?from=search&seid=8297901867903515493 简单状态管理: context API unstated。 复杂状态管理:数据流: 单项数据流(redu 阅读全文
posted @ 2021-02-10 17:29 程序员草莓 阅读(1330) 评论(0) 推荐(0) 编辑
摘要: 安装包: yarn add redux, yarn add redux-thunk (redux-异步请求) yarn add axios yarn add react-redux, react-redux。 { provider , connect } {provider store=store} 阅读全文
posted @ 2021-02-10 16:55 程序员草莓 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 1 问题。 如果想要发送一个action,导入一个store。 store.dispatch() -> reducer --> return -->store 如果多个组件想要接受state。 导入store。 store.subscribe( ()=> (接受到返回的数据)) 监听到 才能拿到数据 阅读全文
posted @ 2021-02-10 14:12 程序员草莓 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1 什么是redux? redux 用于js状态容器,提供可以预测化的状态管理。 redux可以构建一致化应用。 2 redux设计初衷: js 管理:state 。 state包括: 服务器响应,缓存数据,本地生成为持久化到服务器的数据,UI状态。 管理 不断变化的state非常麻烦,如果一个mo 阅读全文
posted @ 2021-02-09 17:48 程序员草莓 阅读(76) 评论(0) 推荐(0) 编辑
摘要: react redux react-redux(facebook 方便操作) 必须记住的5点: 容器组件( contains ) 和UI组件式(component)父子关系。 UI 组件 不能和redux打交道。 容器组件 可以随意的和redux打交道。可以随意使用rudex的api。 容器组件给 阅读全文
posted @ 2021-02-09 14:47 程序员草莓 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 零.不用redux方法: 目录:src: component: count: //reducers 每一个组件都得有一个reducers。 index.jsx//(store只有一个。)this,setState({count: count+value*1 } ) // 上面的value是字符串,* 阅读全文
posted @ 2021-02-08 17:30 程序员草莓 阅读(73) 评论(0) 推荐(0) 编辑
摘要: const a = () => 1 const.log(a()) ; // console.log(a()) :1 const a = b => 1+b const.log(a(9)) ; // console.log(a()) :10 返回一个对象:{}是默认成为一个函数, const a = b 阅读全文
posted @ 2021-02-08 17:15 程序员草莓 阅读(70) 评论(0) 推荐(0) 编辑
摘要: git 面试大全: https://blog.nowcoder.net/n/253163e1ac1d482db6482fc7f6522586 https://segmentfault.com/a/1190000019315509 https://blog.csdn.net/nobody_1/arti 阅读全文
posted @ 2021-02-08 16:33 程序员草莓 阅读(815) 评论(0) 推荐(0) 编辑
摘要: 解决思路就是: 保存 state_copy = state. 2 state赋值后 重新挂载。但是出现的问题就是页面上 保留了残值,没有刷新。 或者就是案件直接调用api,然后一次调用8个api全部清空。 第一种失败的原因: 一种是,state_copy需要深拷贝,浅拷贝 , 导致state_cop 阅读全文
posted @ 2021-02-08 11:21 程序员草莓 阅读(84) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页