锤子前端
11:44 · 2024年11月22日 · 周五
#文章 #React 基于 useSyncExternalStore 封装自定义 hook 应该注意的问题,还包括推荐了一个库 superjson
https://www.nico.fyi/blog/be-careful-with-usesyncexternalstore
推荐的库:
superjson
Nico's Blog
Be careful with useSyncExternalStore
Learn how to avoid infinite render loops when using useSyncExternalStore with non-primitive values in React, and discover a robust solution for storing objects in localStorage with proper type safety.
Home
Tags
About
Powered by
BroadcastChannel
&
Sepia