
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-hookstack
Advanced tools
A lightweight and powerful collection of reusable React hooks designed to simplify state management, event handling, and UI logic in your React apps.
📘 Documentation
Comprehensive documentation is available here
Explore all hooks interactively on Storybook:
👉 Live Demo
Once published to npm:
npm install react-hookstack
# or
yarn add react-hookstack
# Inside react-hookstack/
npm link
# In your target React project:
npm link react-hookstack
| Hook Name | Description |
|---|---|
| useArray | Manage array state easily |
| useAsync | Handle async operations |
| useBoolean | Manage boolean state |
| useClickOutside | Detect clicks outside element |
| useClipboardHistory | Keep track of copied clipboard values |
| useCookie | Read and write browser cookies |
| useCopyToClipboard | Copy text to clipboard |
| useCounter | Simple counter hook |
| useDarkMode | Detect dark mode preference |
| useDebounce | Debounce changing values |
| useDebouncedCallback | Debounced function execution |
| useDrag | Handle drag events |
| useEventCallback | Stable event callback function |
| useEventListener | Attach event listener safely |
| useFetch | Fetch data with state management |
| useFocus | Manage element focus |
| useFormState | Manage form state |
| useGeoLocation | Get user's geographic location |
| useHover | Track hover state |
| useIdle | Detect user inactivity |
| useIndexedDB | Interact with IndexedDB storage |
| useInput | Manage input value |
| useIntersectionObserver | Observe element visibility in viewport |
| useInterval | Set up recurring interval |
| useLocalStorage | Sync state with localStorage |
| useLongPress | Detect long press actions |
| useMap | Manage Map state |
| useMergeState | Merge object state updates |
| useMousePosition | Track mouse cursor position |
| useOnlineStatus | Detect online/offline status |
| usePersistedState | Persist state in storage |
| usePortal | Render element in React portal |
| usePreferredLanguage | Get user's preferred language |
| usePrevious | Get previous value |
| usePreviousDistinct | Get previous distinct value |
| useRafInterval | Interval synced with requestAnimationFrame |
| useRafState | State synced with requestAnimationFrame |
| useReducerWithLogger | Reducer with state change logging |
| useRequestAnimationFrame | Execute function every animation frame |
| useSSE | Handle Server-Sent Events |
| useScrollPosition | Track scroll position |
| useSessionStorage | Sync state with sessionStorage |
| useThrottle | Throttle changing values |
| useThrottledCallback | Throttled function execution |
| useTimeout | Execute callback after delay |
| useToggle | Toggle boolean state |
| useToggleSet | Toggle values in a set |
| useURLSearchParams | Read and update URL search parameters |
| useUndoRedo | Undo and redo state changes |
| useUpdateEffect | Run effect except first render |
| useVisibilityChange | Detect page visibility changes |
| useWebSocket | Handle WebSocket connection |
| useWhyDidYouUpdate | Debug component re-renders |
| useWindowSize | Track window size |
import React from "react";
import { useToggle } from "react-hookstack";
export const Example = () => {
const [isOpen, toggle] = useToggle(false);
return (
<div>
<button onClick={toggle}>
{isOpen ? "Hide" : "Show"} Details
</button>
{isOpen && <p>Here are the details...</p>}
</div>
);
};
git clone https://github.com/Shakir-Afridi/react-handyhooks.git
cd react-handyhooks
npm install
npm run dev
npm run build
npm link
# then in your test project:
npm link react-handyhooks
This project is licensed under the MIT License.
Contributions are welcome! If you’d like to add new hooks or fix bugs, please open an issue or submit a pull request.
# Fork & clone
git clone https://github.com/Shakir-Afridi/react-handyhooks.git
# Create a feature branch
git checkout -b feature/my-new-hook
# Commit changes
git commit -m "feat: add useXYZ hook"
# Push & open PR
git push origin feature/my-new-hook
React Hookstack — maintained by passionate open-source developers who believe in clean, reusable React logic
If you find this library useful, please give it a star ⭐ on GitHub — it helps others discover and support the project!
FAQs
A collection of powerful and reusable React hooks.
We found that react-hookstack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.