π οΈ Installation guide
npm i react-super-hooks
β
Available Hooks
-
useFetch: Manages data fetching within components
-
usePrevious: Tracks the previous value of a state
-
useToggle: Handles boolean state toggling in components
-
useForm: Simplifies form state management
-
useHover: Detects whether an element is being hovered over
-
useUpdateEffect: Executes an effect only after the first render
-
useOnClickOutside: Detects clicks that occur outside a specified element
-
useDebounce: Delays the update of a value until after a specified delay
-
useScript: Dynamically loads and manages external scripts
-
useLocalStorage & useSessionStorage: Facilitates interaction with browser storage mechanisms such as localStorage and sessionStorage
-
useWindowSize: Tracks the dimensions of the browser window
β¨ Features
-
TypeScript Support: Comprehensive TypeScript support ensures type safety and enhances the development experience.
-
Lightweight: Minimal footprint to ensure application remains fast and efficient.
-
Easy Integration: Simple and intuitive API for quick integration into your existing projects.
-
SSR Compatibility: Compatible with server-side rendering (SSR) for seamless integration into server-rendered applications.
-
ESLint and Prettier Integration: Built-in support for ESLint and Prettier to maintain code quality and consistency.
-
Well-Written Documentation: Detailed documentation to simplify usage and implementation.
π Usage
To use these custom hooks, import them by name from the library. Here is a quick example of how to use this package in your project:
import { useFetch, usePrevious, useToggle } from "react-super-hooks";
π» Demo
Check out the live demo here: CodeSandbox
Check out the repository for the demo here: Github
π Documentation
For documentation, examples and other details please refer Documentation
π License
This project is open-source and licensed under the MIT License.
π€ Contributions
We encourage your contributions! If you have suggestions, enhancements, or bug fixes, please open an issue or submit a pull request.
βπ» Creator
Ishan Trivedi