This npm package includes a range of custom hooks for React, created to make project development easier and more efficient.
npm i react-super-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
- 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.
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";
Check out the live demo here: CodeSandbox
Check out the repository for the demo here: Github
For documentation, examples and other details please refer Documentation
This project is open-source and licensed under the MIT License.
We encourage your contributions! If you have suggestions, enhancements, or bug fixes, please open an issue or submit a pull request.