You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-reuse-hooks

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-reuse-hooks

A collection of 30+ production-ready reusable React hooks for web apps, covering state, effects, media, forms, and utilities.

3.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

⚛️ react-reuse-hooks

A lightweight and powerful collection of 28+ reusable custom React hooks to supercharge your development. Simplify your logic for state management, side effects, performance optimizations, form handling, storage, and more — all in one compact package.

Created with ❤️ by Rahul Chaurasia

📦 Installation

npm install react-reuse-hooks
# or
yarn add react-reuse-hooks

📚 Hook Usage Summary Table

HookDescriptionExample Usage
useLocalStorageSync state with localStorageconst [value, setValue] = useLocalStorage('key', 'default')
useDebounceDebounce a valueconst debounced = useDebounce(inputValue, 500)
useToggleToggle a booleanconst [isOn, toggle] = useToggle(false)
useClickOutsideDetect outside clicksuseClickOutside(ref, () => alert('Clicked outside!'))
useThrottleThrottle a value updateconst throttled = useThrottle(inputValue, 300)
usePreviousGet previous valueconst prev = usePrevious(value)
useTimeoutRun function after delayuseTimeout(() => alert('Hello'), 1000)
useUpdateEffectEffect only on updateuseUpdateEffect(() => {}, [count])
useHoverDetect hoverconst [ref, hovered] = useHover()
useOnlineStatusTrack online statusconst online = useOnlineStatus()
useCopyToClipboardCopy text to clipboardconst [copied, copy] = useCopyToClipboard()
useClipboardAlso allows clipboard copyingconst [copied, setClipboard] = useClipboard()
useDarkModeToggle dark modeconst [darkMode, toggleDarkMode] = useDarkMode()
useScrollPositionGet scroll positionconst pos = useScrollPosition()
useWindowSizeGet window sizeconst { width, height } = useWindowSize()
useEventListenerAdd event listeneruseEventListener('resize', handleResize)
useOnScreenDetect element visibilityconst visible = useOnScreen(ref)
useWhyDidYouUpdateDebug re-rendersuseWhyDidYouUpdate('MyComponent', props)
useFocusHandle focus stateconst [ref, focused] = useFocus()
useGeolocationGet geolocationconst { latitude, longitude } = useGeolocation()
useElementSizeGet element dimensionsconst [ref, size] = useElementSize()
useDeviceOrientationGet device orientation dataconst { alpha, beta, gamma } = useDeviceOrientation()
useForceUpdateForce re-renderconst forceUpdate = useForceUpdate()
useInputManage input field logicconst { value, onChange, reset } = useInput()
useStateWithCallbackState with callback on updateconst [count, setCount] = useStateWithCallback(0, cb)
useSessionStorageUse session storage like stateconst [data, setData] = useSessionStorage('key', initialValue)
useKeyPressDetect specific key pressconst isEnter = useKeyPress('Enter')
useCookieManage browser cookiesconst [cookie, setCookie] = useCookie('user')

📚 My Bestselling Tech Books on Amazon Kindle

Supercharge your React and JavaScript knowledge with these practical, interview-focused books by Rahul Chaurasia. 🚀 600+ developers have already leveled up their skills — now it's your turn!

📘 React JS Machine Coding Projects

Build 30 real-world React components asked in interviews — from star ratings to quiz apps.

📗 Redux & Redux Toolkit With React

Master Redux and Redux Toolkit with practical, scalable React patterns.

📙 JavaScript Interview Mastery

Ace any JS interview with this ultimate guide covering 100+ theory questions.

📕 Top 50 Most Asked JavaScript Coding Questions in Interviews

Practice must-know logic questions (arrays, strings, promises, objects).

📒 Mastering ES6

Deep dive into essential ES6 concepts every developer should master.

⭐ These books are beginner-friendly, interview-validated, and written in a simple, clear language. Perfect for self-paced learners and job seekers.

🌟 Contributions Welcome

Have an idea for a new hook or an improvement? Feel free to open a pull request or raise an issue.

📜 License

MIT © 2025 Rahul Chaurasia

Keywords

react

FAQs

Package last updated on 01 Jun 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