https://github.com/oussamamessaoudi/fetch-react
https://github.com/oussamamessaoudi/fetch-react
axios fetch javascript react react-native reactjs superagent typescript
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/oussamamessaoudi/fetch-react
- Owner: oussamamessaoudi
- Created: 2019-10-07T18:35:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:17:08.000Z (over 3 years ago)
- Last Synced: 2025-02-20T10:20:42.713Z (over 1 year ago)
- Topics: axios, fetch, javascript, react, react-native, reactjs, superagent, typescript
- Language: TypeScript
- Size: 192 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fetch-react
Fetching data using React Component.
## Installation
Add dependency to your project.
```sh
npm install @react-items/fetch --save
```
## Quick Start
```jsx
import React from 'react';
import Fetch, {Error, FetchContext, Success} from '@react-items/fetch';
const defaultValues = {
Loading:
Loading,
NotConnected: (response, status, httpStatus) => (
NotConnected
{JSON.stringify(response)}
{status}
{httpStatus}
)
};
const App = () => (
{(response, status, httpStatus) =>
Success
{JSON.stringify(response)}
{status}
{httpStatus}
}
{(response, status, httpStatus) =>
Error
{JSON.stringify(response)}
{status}
{httpStatus}
}
);
```
# Author
Oussama MESSAOUDI - [@Oussama Messaoudi](https://github.com/oussamamessaoudi/)