useAsyncValue
react-router

useAsyncValue

useAsyncValue(): unknown

Returns the resolved promise value from the closest <Await>.

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

// somewhere in your app
<Await resolve={somePromise}>
  <SomeDescendant />
</Await>
Docs and examples CC 4.0