An open API service indexing awesome lists of open source software.

https://github.com/afonsovreis/essential-hooks-collection

A collection of essential React hooks to speed up web development.
https://github.com/afonsovreis/essential-hooks-collection

help-wanted hook hooks hooks-api-react react reactjs server-side

Last synced: 4 months ago
JSON representation

A collection of essential React hooks to speed up web development.

Awesome Lists containing this project

README

          

# ๐Ÿช Essential Hooks Collection

[![npm version](https://badge.fury.io/js/essential-hooks-collection.svg)](https://www.npmjs.com/package/essential-hooks-collection)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Build & Tests](https://github.com/AfonsoVReis/essential-hooks-collection/actions/workflows/test.yml/badge.svg)](https://github.com/AfonsoVReis/essential-hooks-collection/actions)

A **collection of essential React hooks**.

## ๐Ÿš€ Features

โœ… **TypeScript Support**
โœ… **Optimized for React 18+**
โœ… **JavaScript & TypeScript Compatibility**
โœ… **Typedoc-Generated Documentation**

---

## ๐Ÿ“ฆ Installation

Using **npm**:

```sh
npm install essential-hooks-collection
```

Using **yarn**:

```sh
yarn add essential-hooks-collection
```

---

## ๐Ÿ”ง Usage

Import the hooks in your React project:

```tsx
import { useLocalStorage, useWindowSize } from "essential-hooks-collection";
```

For a full list of hooks and their API documentation, visit:
๐Ÿ“– **[Typedoc Documentation](https://AfonsoVReis.github.io/essential-hooks-collection/)**

---

## ๐Ÿ“ Documentation

This library uses **TypeDoc** to generate API documentation.

To generate documentation locally:

```sh
npm run docs
```

To deploy the documentation to **GitHub Pages**, run:

```sh
npm run docs:deploy
```

Live Documentation:
๐Ÿ“– **[View Docs](https://AfonsoVReis.github.io/essential-hooks-collection/)**

---

## ๐Ÿงช Running Tests

This library includes **Jest tests** for all hooks.

To run tests:

```sh
npm test
```

To run tests in **watch mode**:

```sh
npm run test:watch
```

To check **test coverage**:

```sh
npm run test:coverage
```

---

## ๐Ÿค Contributing

### ๐Ÿ’ก How to Contribute

1. **Fork the repository** ๐Ÿ“Œ
2. **Create a new branch** (`git checkout -b feature/new-hook`)
3. **Push to the branch** (`git push origin feature/new-hook`)
4. **Open a pull request** ๐Ÿš€

---