-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
141 additions
and
8 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,6 @@ | |
|
||
## SPA | ||
|
||
> //todo: 整理位置 | ||
页面渲染为前端渲染,共用一套 html。前端路由切换,匹配不同的组件。 | ||
|
||
通过一系列的 js 文件进行前端渲染构建页面。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# React 新动态 | ||
|
||
## React Compiler | ||
|
||
近几年,许多前端框架拥抱基于 Signal 的细粒度更新,用于优化前端框架的性能问题。而React 基于 Fiber 的diff 更新成为了最大的短板,大量 re-render 造成的性能损耗,是不得不面对的挑战。(细粒度更新并非所有场景都有明显优势) | ||
|
||
React 提供了 memo/useMemo/useCallback 供开发者优化项目性能,但上手难度不低。 | ||
|
||
React 19 将会推出 React Compiler,在开发者不调整任何代码的情况下,自动优化项目性能。帮助我们不使用上面几个api的情况下优化re-render。 | ||
|
||
## React Server Components | ||
|
||
在Next.js中得到落地的实现。 | ||
|
||
## 围绕异步编程的开发体验提升 | ||
|
||
减少使用useEffect。 | ||
使用新的use Api,可以从Promise/context中读取值,不是一个hook,可以在循环中或者条件语句中使用。但必须在组件或hook中使用。 | ||
|
||
## form 相关hooks | ||
|
||
- useFormStatus [useFormStatus – React](https://react.dev/reference/react-dom/hooks/useFormStatus) | ||
|
||
增强表单提交体验。在数据提交期间显示加载动画。 | ||
|
||
- useFormState | ||
|
||
简化服务器交互,管理表单提交状态并捕获服务器响应。不需要通常的 useEffect + setMessage。 | ||
|
||
## useOptimistic | ||
|
||
乐观更新,为预期成功的场景设计,预期的反馈使交互感觉更快。 | ||
|
||
## References | ||
|
||
- [被严重低估!React 19 又是一次开发方式的变革,useEffect 将会逐渐退出历史舞台](https://mp.weixin.qq.com/s?__biz=MzI4NjE3MzQzNg==&mid=2649868281&idx=1&sn=034c7a5b4696e70326d351c21ebabb37&chksm=f23a65a3bad3ded1696a5ad8e360c8741a0e0c5fe5845fe036146a14a7f22aaf9ffef7857a73&scene=132&exptype=timeline_recommend_article_extendread_samebiz&show_related_article=1&subscene=0&scene=132#wechat_redirect) |