Promise-based React Data Loader – react-async

Category: Featured , Others , React
Author: ghengeveld
Views Total: no views
Official Page: Go to website
Publish Date: May 13, 2019
License: MIT

React component and hook for declarative promise resolution and data fetching. Leverages the Render Props pattern and Hooks for ultimate flexibility as well as the new Context API for ease of use.

Makes it easy to handle loading and error states, without assumptions about the shape of your data or the type of request.


  • Zero dependencies
  • Works with promises, async/await and the Fetch API
  • Choose between Render Props, Context-based helper components or the useAsync and useFetch hooks
  • Provides convenient isLoadingstartedAtfinishedAt, et al metadata
  • Provides cancel and reload actions
  • Automatic re-run using watch or watchFn prop
  • Accepts onResolve and onReject callbacks
  • Supports abortable fetch by providing an AbortController
  • Supports optimistic updates using setData
  • Supports server-side rendering through initialValue
  • Comes with type definitions for TypeScript
  • Works well in React Native too!


# Yarn
$ yarn add react-async

$ npm install react-async --save



Leave a Reply