react-super-hooks
v1.5.1
Published
A lightweight library of commonly used React custom hooks, written in TypeScript, designed to simplify and enhance your React projects.
Downloads
35
Maintainers
Readme
🛠️ 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.