react-async

? Flexible promise-based React data loader

  • Owner: async-library/react-async
  • Platform:
  • License:: ISC License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

React component and hook for declarative promise resolution and data fetching. Makes it easy to handle every
state of the asynchronous process, without assumptions about the shape of your data or the type of request.
Use it with fetch, Axios or other data fetching libraries, even GraphQL.

  • Zero dependencies
  • Works with promises, async/await and the Fetch API
  • Now with experimental Suspense support
  • Choose between Render Props, Context-based helper components or the useAsync and useFetch hooks
  • Debug and develop every part of the loading sequence with the React Async DevTools
  • Provides convenient isPending, startedAt, finishedAt, et al metadata
  • Provides cancel and reload actions
  • Automatic re-run using watch or watchFn prop
  • Accepts onResolve, onReject and onCancel callbacks
  • Supports abortable fetch by providing an AbortController
  • Supports optimistic updates using setData
  • Supports server-side rendering through initialValue
  • Written in TypeScript, ships with type definitions
  • Works well in React Native too!

Upgrading to v9

Version 9 comes with a minor breaking change.
See Upgrading for details.

Documentation

Getting started

API

Guide

Contributing

Contributors

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Similar projects

Main metrics

Overview
Name With Ownerasync-library/react-async
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 3)
Platform
License:ISC License
所有者活动
Created At2018-08-12 11:53:05
Pushed At2025-06-19 10:57:45
Last Commit At2020-03-27 23:32:07
Release Count68
Last Release Namev10.0.1 (Posted on )
First Release Namev3.0.0 (Posted on 2018-08-13 14:13:09)
用户参与
Stargazers Count2.1k
Watchers Count12
Fork Count94
Commits Count824
Has Issues Enabled
Issues Count114
Issue Open Count31
Pull Requests Count139
Pull Requests Open Count27
Pull Requests Close Count53
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private