5.0.0 ā€¢ Published 3 years ago

react-data-wrapper v5.0.0

Weekly downloads
66
License
MIT
Repository
github
Last release
3 years ago

react-data-wrapper

Simple ReactJS component for rendering data with loading, failure & empty states.

Note: required React v16.9+

Usage

import DataWrapper from 'react-data-wrapper';

<DataWrapper
  fetcher={store.fetch}
  loading={<div>Loading posts...</div>}
  failure={<ErrorLoading />}
  isEmpty={store.empty}
  empty={<div>No data</div>}
>
  <PostsList posts={store.posts} />
</DataWrapper>

Note: ErrorLoading interface:

interface ErrorLoadingProps {
  reloading?: boolean;
  onReloadClick?: () => Promise<void>;
}

šŸ“ Example code

Install

npm i -S react-data-wrapper
5.0.0

3 years ago

4.0.0

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago