New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-hookstack

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hookstack

A collection of powerful and reusable React hooks.

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

⚡ React Hookstack

license issues typescript react

A lightweight and powerful collection of reusable React hooks designed to simplify state management, event handling, and UI logic in your React apps.

🚀 Features

  • 🧠 Smart utilities — abstract common React logic into reusable hooks
  • 🪶 Lightweight — fast, efficient, and easy to integrate
  • ⚙️ TypeScript support — fully typed API
  • 🧩 Composable — integrate easily into existing code
  • 🔧 Framework agnostic — works with any React setup (Vite, CRA, Next.js, etc.)

📘 Documentation

Comprehensive documentation is available here

👉 Documentation

📘 Storybook

Explore all hooks interactively on Storybook:
👉 Live Demo

📦 Installation

Once published to npm:

npm install react-hookstack
# or
yarn add react-hookstack

If you’re developing locally and want to test it

# Inside react-hookstack/
npm link

# In your target React project:
npm link react-hookstack

🧠 Available Hooks

Hook NameDescription
useArrayManage array state easily
useAsyncHandle async operations
useBooleanManage boolean state
useClickOutsideDetect clicks outside element
useClipboardHistoryKeep track of copied clipboard values
useCookieRead and write browser cookies
useCopyToClipboardCopy text to clipboard
useCounterSimple counter hook
useDarkModeDetect dark mode preference
useDebounceDebounce changing values
useDebouncedCallbackDebounced function execution
useDragHandle drag events
useEventCallbackStable event callback function
useEventListenerAttach event listener safely
useFetchFetch data with state management
useFocusManage element focus
useFormStateManage form state
useGeoLocationGet user's geographic location
useHoverTrack hover state
useIdleDetect user inactivity
useIndexedDBInteract with IndexedDB storage
useInputManage input value
useIntersectionObserverObserve element visibility in viewport
useIntervalSet up recurring interval
useLocalStorageSync state with localStorage
useLongPressDetect long press actions
useMapManage Map state
useMergeStateMerge object state updates
useMousePositionTrack mouse cursor position
useOnlineStatusDetect online/offline status
usePersistedStatePersist state in storage
usePortalRender element in React portal
usePreferredLanguageGet user's preferred language
usePreviousGet previous value
usePreviousDistinctGet previous distinct value
useRafIntervalInterval synced with requestAnimationFrame
useRafStateState synced with requestAnimationFrame
useReducerWithLoggerReducer with state change logging
useRequestAnimationFrameExecute function every animation frame
useSSEHandle Server-Sent Events
useScrollPositionTrack scroll position
useSessionStorageSync state with sessionStorage
useThrottleThrottle changing values
useThrottledCallbackThrottled function execution
useTimeoutExecute callback after delay
useToggleToggle boolean state
useToggleSetToggle values in a set
useURLSearchParamsRead and update URL search parameters
useUndoRedoUndo and redo state changes
useUpdateEffectRun effect except first render
useVisibilityChangeDetect page visibility changes
useWebSocketHandle WebSocket connection
useWhyDidYouUpdateDebug component re-renders
useWindowSizeTrack window size

🧩 Example Usage

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>
  );
};

Development

git clone https://github.com/Shakir-Afridi/react-handyhooks.git
cd react-handyhooks
npm install

Start development mode

npm run dev

Build for production

npm run build

To test it in another project locally

npm link
# then in your test project:
npm link react-handyhooks

🧾 License

This project is licensed under the MIT License.

💡 Contributing

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

👨‍💻 Author

React Hookstack — maintained by passionate open-source developers who believe in clean, reusable React logic

⭐ Support

If you find this library useful, please give it a star ⭐ on GitHub — it helps others discover and support the project!

Keywords

  • react
  • hooks
  • react-hooks
  • custom-hooks
  • typescript
  • state-management
  • utility-hooks
  • ui-hooks
  • performance-hooks
  • browser-hooks
  • frontend
  • react-library

Hooks

  • useArray
  • useAsync
  • useBoolean
  • useClickOutside
  • useClipboardHistory
  • useCookie
  • useCopyToClipboard
  • useCounter
  • useDarkMode
  • useDebounce
  • useDebouncedCallback
  • useDrag
  • useEventCallback
  • useEventListener
  • useFetch
  • useFocus
  • useFormState
  • useGeoLocation
  • useHover
  • useIdle
  • useIndexedDB
  • useInput
  • useIntersectionObserver
  • useInterval
  • useLocalStorage
  • useLongPress
  • useMap
  • useMergeState
  • useMousePosition
  • useOnlineStatus
  • usePersistedState
  • usePortal
  • usePreferredLanguage
  • usePrevious
  • usePreviousDistinct
  • useRafInterval
  • useRafState
  • useReducerWithLogger
  • useRequestAnimationFrame
  • useSSE
  • useScrollPosition
  • useSessionStorage
  • useThrottle
  • useThrottledCallback
  • useTimeout
  • useToggle
  • useToggleSet
  • useURLSearchParams
  • useUndoRedo
  • useUpdateEffect
  • useVisibilityChange
  • useWebSocket
  • useWhyDidYouUpdate
  • useWindowSize

Keywords

react

FAQs

Package last updated on 28 Oct 2025

Did you know?

Socket

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.

Install

Related posts