v6.2.0: Standalone helper components
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>
)
}