Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sumgwork/react-custom-hooks
Custom react hooks
https://github.com/sumgwork/react-custom-hooks
Last synced: about 1 month ago
JSON representation
Custom react hooks
- Host: GitHub
- URL: https://github.com/sumgwork/react-custom-hooks
- Owner: sumgwork
- Created: 2020-05-18T09:49:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T06:15:05.000Z (about 2 years ago)
- Last Synced: 2024-11-09T05:10:48.921Z (3 months ago)
- Language: JavaScript
- Size: 2.67 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-custom-hooks
> Useful list of custom React hooks
[![NPM](https://img.shields.io/npm/v/@sgovil/react-custom-hooks)](https://www.npmjs.com/package/@sgovil/react-custom-hooks)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![demo site](https://img.shields.io/badge/demo-site-green)](https://sumgwork.github.io/react-custom-hooks/)## Install
```bash
npm install --save @sgovil/react-custom-hooks
```## Usage
```jsx
import React from "react";
import useFetch from "@sgovil/react-custom-hooks";export default function App() {
const [response, error, loading] = useFetch(
"https://jsonplaceholder.typicode.com/todos"
);
return (
React Custom Hooks
{loading &&
Loading...}
{!loading && error &&{error.message}}
{!loading && !error && response && (
Fetch Complete
{JSON.stringify(response, undefined, 2)}
)}
);
}
```## License
MIT © [sumgwork](https://github.com/sumgwork)
---
This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).