Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fasunle/react-utils
https://github.com/fasunle/react-utils
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/fasunle/react-utils
- Owner: Fasunle
- Created: 2024-05-23T08:07:05.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-23T08:20:24.000Z (8 months ago)
- Last Synced: 2025-01-16T07:24:51.586Z (11 days ago)
- Language: TypeScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Utils
This library provides a set of utility functions for working with React components and hooks.
## Installation
npm install Fasunle/react-utils
## Usage
### `useDebounce`
The `useDebounce` hook is a utility for debouncing a value. It takes two arguments:
1. `value`: The value to debounce.
2. `delay` (optional): The delay in milliseconds. Defaults to `200`.Example:
```tsx
import { useHashRoute } from 'Fasunle/react-utils';const { hash, changeHash } = useHashRoute();
```Register it to a click event or any other trigger as follow:
```tsx
changeHash('/settings')}>Settings
```