https://github.com/lararosekelley/lib-react-hooks
General purpose React hooks library ⚛️
https://github.com/lararosekelley/lib-react-hooks
javascript mdx npm react react-hooks typescript
Last synced: 19 days ago
JSON representation
General purpose React hooks library ⚛️
- Host: GitHub
- URL: https://github.com/lararosekelley/lib-react-hooks
- Owner: lararosekelley
- License: other
- Created: 2014-09-08T17:56:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-26T16:02:30.000Z (over 2 years ago)
- Last Synced: 2025-04-11T01:01:50.378Z (20 days ago)
- Topics: javascript, mdx, npm, react, react-hooks, typescript
- Language: TypeScript
- Homepage: https://react-hooks-library.tlk.codes
- Size: 5.42 MB
- Stars: 143
- Watchers: 4
- Forks: 2
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# React Hooks Library
> General purpose React hooks library
---
[](https://badge.fury.io/js/lib-react-hooks)
[](https://travis-ci.org/tylucaskelley/lib-react-hooks)
[](https://coveralls.io/github/tylucaskelley/lib-react-hooks?branch=master)## Installation
Install with `yarn`:
```bash
$ yarn add lib-react-hooks
```Or, `npm` if you prefer:
```bash
$ npm install --save lib-react-hooks
```## Usage
Simply import any hooks you want to use in your React component. Example using `useAsync`:
```js
import React from 'react';
import { useAsync } from 'lib-react-hooks';const Component = () => {
const request = useAsync(async () => {
const response = await fetch('https://api.example.com/users/123');
return response.json();
});return (
{request.complete ? (
{`Name: ${request.data.name}`}
) : (
Loading...
)}
);
};
```## Available hooks
See the [documentation site](https://react-hooks-library.tlk.codes) for more.
## License
MIT License. See [LICENSE](./LICENSE) file for details.