useAsyncValue

useAsyncValue

摘要

参考文档 ↗

返回最近的 Await 组件解析后的 Promise 值。

function SomeDescendant() {
  const value = useAsyncValue();
  // ...
}

// somewhere in your app
<Await resolve={somePromise}>
  <SomeDescendant />
</Await>;

签名

useAsyncValue(): unknown
文档和示例 CC 4.0