react-fetch-loader
v1.0.0
Published
Higher order component for managing loading state and error state.
Downloads
14
Readme
React Fetch Loader
Higher order component for managing loading state and error state.
Usage Example
Props:
- fetch: the AJAX call as a promise (required)
- errorText: text to display on error state
Basic Example:
<FetchLoader fetch={() => fetch('https://api.github.com/users/asafda')} errorText="Ooops...">
<DataDisplayer/>
</FetchLoader>Installation
Via NPM:
npm install --save react-fetch-loaderVia Yarn:
yarn add react-fetch-loader