React: Rendering using Concurrent Mode and Suspense

栏目: IT技术 · 发布时间: 4年前

内容简介:Front-end frameworks enable developers to build apps with better UI and UX. Well-known frameworks like React, Vue, and Angular are commonly used to build responsive applications with high performance and native experience. Users have a similar experience w

Understanding React’s experimental Concurrent and Suspense.

React: Rendering using Concurrent Mode and Suspense

Front-end frameworks enable developers to build apps with better UI and UX. Well-known frameworks like React, Vue, and Angular are commonly used to build responsive applications with high performance and native experience. Users have a similar experience with apps created with each of these frameworks. However, there are some inherent problems common to all of them:

1) Race Conditions: Race conditions occur when a page requires multiple inputs and is unable to fully load as some of the inputs are delayed or not available. This delay is common when fetching data from APIs. If some API calls depend on others, then it is vital that they are sequenced correctly. Wrong assumptions regarding the priority of such API calls can cause Race conditions due to inaccurate timing.

2) Lots of Spinners: It is common to load the full structure of a page with temporary placeholders instead of the actual content. Such pages sometimes will display multiple spinners until data is available to load. However, having to display too many spinners on a web page can lead to bad user experience.

3) Blocking rendering: Most front-end frameworks work by updating changes to the Virtual DOM and then repainting the screen accordingly. Some apps do this before all data has been fetched. So each time data is received, the Virtual DOM is updated, and the screen is repainted, causing other threads to wait unnecessarily.

Waiting for multiple repaints can lead to bad user experience. Other threads continue to wait unnecessarily while the main thread loads. Another negative impact is that a higher number of API calls leads to a bigger package size.


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

最优化导论

最优化导论

Edwin K. P. Chong、Stanislaw H. Zak / 孙志强、白圣建、郑永斌、刘伟 / 电子工业出版社 / 2015-10 / 89.00

本书是一本关于最优化技术的入门教材,全书共分为四部分。第一部分是预备知识。第二部分主要介绍无约束的优化问题,并介绍线性方程的求解方法、神经网络方法和全局搜索方法。第三部分介绍线性优化问题,包括线性优化问题的模型、单纯形法、对偶理论以及一些非单纯形法,简单介绍了整数线性优化问题。第四部分介绍有约束非线性优化问题,包括纯等式约束下和不等式约束下的优化问题的最优性条件、凸优化问题、有约束非线性优化问题的......一起来看看 《最优化导论》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具