![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
AhianWang
请叫我爱隐王!
展开
-
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 评论 -
JavaScript宏任务和微任务
先看一段代码console.log('script start');setTimeout(function() { console.log('setTimeout');}, 0);Promise.resolve().then(function() { console.log('promise1');}).then(function() { con...转载 2019-08-27 22:31:49 · 202 阅读 · 0 评论