![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
文章平均质量分 96
AhianWang
请叫我爱隐王!
展开
-
React Diffing 自顶向下
Fiber下的Diff算法原创 2022-03-28 15:49:54 · 1060 阅读 · 0 评论 -
React的render不是纯函数? triggering nested component updates from render is not allowed
“Warning: Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. ”这里提供一种排查方案:这个问题可能会在开发环境中才会出现,如果你的项目中使用了mobx,并且在render中使用了.原创 2020-08-20 16:55:52 · 3027 阅读 · 0 评论 -
使用hook时,把携带setState的方法通过props传给子类组件,调用不生效?
一、问题来源为了学习React的HOOK,我实现了一个简单的计数器,但是把动态修改计数器count的方法通过props传递给子组件时,出现了只生效一次,再次调用不生效的问题。二、场景介绍父组件是一个函数式组件,使用了useState来动态更新Count。子组件是类组件,通过父组件传递的回调函数props.changeCount来修改父组件的count。但是出现了调用changeCount不生效的奇怪现象。下面是出现问题的代码,大家可以先分析下问题出在了哪里。import React,{useStat原创 2020-08-06 18:39:53 · 2511 阅读 · 0 评论 -
Redux中间件的引用
具体使用请参照https://github.com/zalmoxisus/redux-devtools-extension原创 2018-07-16 10:42:47 · 661 阅读 · 0 评论 -
React 拆分组件为UI组件和容器组件
首先要感谢imooc网的DellLee老师,我的React 是跟着这位老师入门的,有兴趣的同学可以了解一下,本博客纯为手记,有什么不对的地方还请不吝赐教!话不多说先上代码!import React,{ Component,Fragment } from 'react';import 'antd/dist/antd.css';import { Input,Button,List } from '...原创 2018-07-15 09:22:06 · 2820 阅读 · 1 评论 -
React 的无状态组件
无状态组件就是一个函数!原创 2018-07-15 10:01:02 · 1327 阅读 · 0 评论