Comments (10)
- 编码之前思考
- 编码中代码思考,以及借用工具分析
- 打包再次处理
砖家威武
from blog.
砖家的思维着实缜密。
from blog.
赞
from blog.
首先你可以打开这个示例页面
这个页面链接 404 打不开了
from blog.
对于不可变数据,我也有一些类似文章里的思考,但还不能像你这样简单的总结出来,砖家牛逼。
还有 useState 的浅比较,真是学到了
from blog.
牛牛
from blog.
文章很棒~ 纠正一个小问题
也就是执行代码与绘制是同一个线程...
其实浏览器的渲染线程和 js 引擎是两个不同的线程, 并且浏览器 GUI 渲染线程与 JS 引擎是互斥的。
from blog.
React 函数组件的 useState,其 setState 会自动做浅比较,也就是如果你在上面例子中调用了 setState(0) ,函数组件会忽略这次更新,并不会执行 render 的。一般在使用的时候要注意这一点,经常有同学掉进这个坑里面。
这里应该不对吧,React应该是用的Object.is的polyfill去做的比较,贴一个源码链接:
https://github.com/facebook/react/blob/3fb11eed9a166ebab23b778662f54c449fcffad0/packages/react-reconciler/src/ReactFiberHooks.new.js#L829
from blog.
React 函数组件的 useState,其 setState 会自动做浅比较,也就是如果你在上面例子中调用了 setState(0) ,函数组件会忽略这次更新,并不会执行 render 的。一般在使用的时候要注意这一点,经常有同学掉进这个坑里面。
这里应该不对吧,React应该是用的Object.is的polyfill去做的比较,贴一个源码链接: https://github.com/facebook/react/blob/3fb11eed9a166ebab23b778662f54c449fcffad0/packages/react-reconciler/src/ReactFiberHooks.new.js#L829
from blog.
示例页面打不开
from blog.
Related Issues (20)
- 如何升级到 React 18 HOT 1
- React 18 对 Hooks 的影响:一
- React 18 总览 HOT 1
- 我认为 web3 是什么(大白话 web3) HOT 3
- React useEvent:砖家说的没问题
- Base64 编码原来这么简单 HOT 2
- issue一般啥时候用? HOT 1
- 我要去哪里?- 写在我的 30 岁 HOT 9
- 前端好还是后端好,看看7年前端和后端怎么说 HOT 2
- 只想做开源项目、技术项目,不想做业务,有办法吗?
- 前端小白半年准备进大厂
- 程序员如何实现财富自由 HOT 1
- 离职后聊一聊我眼中的蚂蚁 HOT 2
- 前端工程师个人的价值在哪里(换一个人能不能做?)【前端晋升必看】
- rm
- 2022 年:我在死亡边缘走过 HOT 4
- 前端质量体系之纸上谈兵 HOT 1
- 大白话虚拟货币理财原理 HOT 1
- 前端没了?也许是刚开始
- Telegram bot 和 mini apps 开发简易教程
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.