短评 · ·

X 归档 2025-03-19

1 条动态 · 图 1 · 视频 1
😍 Falling in love with the React.use() API in Expo Router.

Call a server function without awaiting it, pass promise to a component that's wrapped in React.Suspense, await with use().

◆ No hooks—completely declarative.
◆ Easy to add custom caching/syncing.
◆ Type-safe API.
😍 爱上 Expo Router 里的 React.use() API 了。

调用 server 函数无需 await,把 promise 传给包在 React.Suspense 里的组件,再用 use() 等待。

◆ 不用 hooks——完全声明式。
◆ 轻松添加自定义缓存/同步。
◆ 类型安全的 API。
@Baconbrix 的配图 1/1