Skip to content

v6.2.0: Standalone helper components

Compare
Choose a tag to compare
@ghengeveld ghengeveld released this 27 Apr 18:06
· 537 commits to master since this release

This separates the <Async.Initial>, <Async.Pending> etc. helper components from <Async> so they can be used with useAsync as well.

import { useAsync, Pending } from "react-async"

function MyComponent() {
  const state = useAsync(...)
  return (
    <Pending state={state}>
      <p>This text is only rendered while performing the initial load.</p>
    </Pending>
  )
}