Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计提醒

react-use-hooksReact USE hooks 搜索

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

374

周安装

15

GitHub Stars

3

下载量

121
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:react-use-hooks(React USE hooks 搜索)
来源仓库:https://github.com/arindampradhan/react-use-skills
仓库路径:skills/react-use-hooks
安装命令:
npx skills add https://github.com/arindampradhan/react-use-skills --skill react-use-hooks
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/arindampradhan/react-use-skills --skill react-use-hooks

简介

提供 React 自定义 Hook 的设计模板与使用示例。

  • 适用于封装业务逻辑、状态管理和副作用处理的通用场景。
  • 通过 npx 安装技能模块,可在多种宿主环境中调用。
  • 建议根据具体业务需求调整 Hook 的职责边界与参数设计。
  • react-use-hooks 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

React-Use Hooks

This skill is a decision-and-implementation guide for react-use hooks in React projects. It maps requirements to the most suitable react-use hook, applies the correct usage pattern, and prefers hook-based solutions over bespoke code to keep implementations concise, maintainable, and performant.

When to Apply

  • Apply this skill whenever assisting user development work in React.
  • Always check first whether a react-use hook can implement the requirement.
  • Prefer react-use hooks over custom code to improve readability, maintainability, and performance.
  • Map requirements to the most appropriate hook and follow the hook's invocation rule.
  • Please refer to the Invocation field in the below hooks table. For example: *NOTE* User instructions in the prompt or AGENTS.md may override a hook's default Invocation rule.

- AUTO: Use automatically when applicable. - EXTERNAL: Use only if the user already installed the required external dependency; otherwise reconsider, and ask to install only if truly needed. - EXPLICIT_ONLY: Use only when explicitly requested by the user.

Hooks

All hooks listed below are part of the react-use library, each section categorizes hooks based on their functionality.

IMPORTANT: Each hook entry includes a short Description and a detailed Reference. When using any hook, always consult the corresponding document in ./references for Usage details and Type Declarations.

Sensors

HookDescriptionInvocation
createBreakpointlaptopL: 1440, laptop: 1024, tablet: 768AUTO
useBatteryReact sensor hook that tracks battery status.AUTO
useGeolocationReact sensor hook that tracks user's geographic location. This hook accepts [position options](httpsAUTO
useHashReact sensor hook that tracks browser's location hash.AUTO
useHoverReact UI sensor hooks that track if some element is being hoveredAUTO
useHoverDirtyTracks mouse hover state using a ref (more direct than useHover).AUTO
useIdleReact sensor hook that tracks if user on the page is idle.AUTO
useIntersectionReact sensor hook that tracks the changes in the intersection of a target element with an ancestor eAUTO
useKeyReact UI sensor hook that executes a handler when a keyboard key is used.AUTO
useKeyboardJsReact UI sensor hook that detects complex key combos like detecting whenEXTERNAL
useKeyPressReact UI sensor hook that detects when the user is pressing a specificAUTO
useKeyPressEventThis hook fires keydown and keyup callbacks, similar to how useKeyAUTO
useLocationReact sensor hook that tracks brower's location.AUTO
useLongPressReact sensor hook that fires a callback after long pressing.AUTO
useMeasureReact sensor hook that tracks dimensions of an HTML element using the [Resize Observer API](https://AUTO
useMediaReact sensor hook that tracks state of a CSS media query.AUTO
useMediaDevicesReact sensor hook that tracks connected hardware devices.AUTO
useMotionReact sensor hook that uses device's acceleration sensor to track its motions.AUTO
useMouseReact sensor hooks that re-render on mouse position changes. useMouse simply tracksAUTO
useMouseHoveredExtended mouse tracking with options for bounded coordinates and hover-only tracking.AUTO
useMouseWheelReact Hook to get deltaY of mouse scrolled in window.AUTO
useNetworkStateTracks the state of browser's network connection.AUTO
useOrientationReact sensor hook that tracks screen orientation of user's device.AUTO
usePageLeaveReact sensor hook that fires a callback when mouse leaves the page.AUTO
usePinchZoomReact sensor hook that tracks the changes in pointer touch events and detects value of pinch differeAUTO
useScratchReact sensor hook that tracks state of mouse "scrubs" (or "scratches").AUTO
useScrollReact sensor hook that re-renders when the scroll position in a DOM element changes.AUTO
useScrollbarWidthHook that will return current browser's scrollbar width.AUTO
useScrollingReact sensor hook that keeps track of whether the user is scrolling or not.AUTO
useSearchParamReact sensor hook that tracks browser's location search param.AUTO
useSizeReact sensor hook that tracks size of an HTML element.AUTO
useStartTypingReact sensor hook that fires a callback when user starts typing. Can be usedAUTO
useWindowScrollReact sensor hook that re-renders on window scroll.AUTO
useWindowSizeReact sensor hook that tracks dimensions of the browser window.AUTO

UI

HookDescriptionInvocation
useAudioCreates <audio> element, tracks its state and exposes playback controls.AUTO
useClickAwayReact UI hook that triggers a callback when userAUTO
useCssReact UI hook that changes [CSS dynamically][gen-5]. Works like "virtual CSS" —AUTO
useDropTriggers on file, link drop and copy-paste.AUTO
useFullscreenDisplay an element full-screen, optional fallback for fullscreen video on iOS.AUTO
useSliderReact UI hook that provides slide behavior over any HTML element. Supports both mouse and touch evenAUTO
useSpeechReact UI hook that synthesizes human voice that speaks a given string.AUTO
useVibrateReact UI hook to provide physical feedback with device vibration hardware using the [Vibration API](AUTO
useVideoCreates <video> element, tracks its state and exposes playback controls.AUTO

Animations

HookDescriptionInvocation
useHarmonicIntervalFnSame as useInterval hook, but triggers all effects with the same delayAUTO
useIntervalA declarative interval hook based on Dan Abramov's article on overreacted.ioAUTO
useRafReact animation hook that forces component to re-render on each requestAnimationFrame,AUTO
useSpringReact animation hook that updates a single numeric value over time accordingEXTERNAL
useTimeoutRe-renders the component after a specified number of milliseconds.AUTO
useTimeoutFnCalls given function after specified amount of milliseconds.AUTO
useTweenReact animation hook that tweens a number between 0 and 1.AUTO
useUpdateReact utility hook that returns a function that forces componentAUTO

Side-Effects

HookDescriptionInvocation
useAsyncReact hook that resolves an async function or a function that returnsAUTO
useAsyncFnReact hook that returns state and a callback for an async function or aAUTO
useAsyncRetryUses useAsync with an additional retry method to easily retry/refresh the async function;AUTO
useBeforeUnloadReact side-effect hook that shows browser alert when user try to reload or close the page.AUTO
useCookieReact hook that returns the current value of a cookie, a callback to update the cookieAUTO
useCopyToClipboardCopy text to a user's clipboard.AUTO
useDebounceReact hook that delays invoking a function until after wait milliseconds have elapsed since the lastAUTO
useErrorReact side-effect hook that returns an error dispatcher.AUTO
useFaviconReact side-effect hook sets the favicon of the page.AUTO
useLocalStorageReact side-effect hook that manages a single localStorage key.AUTO
useLockBodyScrollReact side-effect hook that locks scrolling on the body element. Useful for modal and other overlayAUTO
usePermissionReact side-effect hook to query permission status of browser APIs.AUTO
useRafLoopThis hook call given function within the RAF loop without re-rendering parent component.AUTO
useSessionStorageReact side-effect hook that manages a single sessionStorage key.AUTO
useThrottleReact hooks that throttle.AUTO
useThrottleFnReact hook that invokes a function and then delays subsequent function calls until after wait millisAUTO
useTitleReact side-effect hook that sets title of the page.AUTO

Lifecycles

HookDescriptionInvocation
useCustomCompareEffectA modified useEffect hook that accepts a comparator which is used for comparison on dependencies insAUTO
useDeepCompareEffectA modified useEffect hook that is using deep comparison on its dependencies instead of reference equAUTO
useEffectOnceReact lifecycle hook that runs an effect only once.AUTO
useEventReact sensor hook that subscribes a handler to events.AUTO
useIsomorphicLayoutEffectuseLayoutEffect that does not show warning when server-side rendering, see [Alex Reardon's articleAUTO
useLifecyclesReact lifecycle hook that call mount and unmount callbacks, whenAUTO
useLoggerReact lifecycle hook that console logs parameters as component transitions through lifecycles.AUTO
useMountReact lifecycle hook that calls a function after the component is mounted. Use useLifecycles if yoAUTO
useMountedState> NOTE!: despite having State in its name *this hook does not cause component re-render*.AUTO
usePromiseReact Lifecycle hook that returns a helper function for wrapping promises.AUTO
useShallowCompareEffectA modified useEffect hook that is using shallow comparison on each of its dependencies instead of reAUTO
useUnmountReact lifecycle hook that calls a function when the component will unmount. Use useLifecycles if yAUTO
useUnmountPromiseA life-cycle hook that provides a higher order promise that does not resolve if component un-mounts.AUTO
useUpdateEffectReact effect hook that ignores the first invocation (e.g. on mount). The signature is exactly the saAUTO

State

HookDescriptionInvocation
createGlobalStateA React hook that creates a globally shared state.AUTO
createMemoHook factory, receives a function to be memoized, returns a memoized React hook,AUTO
createReducerFactory for reducer hooks with custom middleware with an identical API as [React's useReducer](httAUTO
createReducerContextFactory for react context hooks that will behave just like React's useReducerAUTO
createStateContextFactory for react context hooks that will behave just like React's useStateAUTO
useBooleanAlias for useToggle. Boolean state hook with a toggle function.AUTO
useCounterReact state hook that tracks a numeric value.AUTO
useDefaultReact state hook that returns the default value when state is null or undefined.AUTO
useFirstMountStateReturns true if component is just mounted (on first render) and false otherwise.AUTO
useGetSetReact state hook that returns state getter function instead ofAUTO
useGetSetStateA mix of useGetSet and useGetSetState.AUTO
useLatestReact state hook that returns the latest state as described in the React hooks FAQAUTO
useListTracks an array and provides methods to modify it.AUTO
useMapReact state hook that tracks a value of an object.AUTO
useMediatedStateA lot like the standard useState, but with mediation process.AUTO
useMethodsReact hook that simplifies the useReducer implementation.AUTO
useMultiStateValidatorEach time any of given states changes - validator function is invoked.AUTO
useNumberAlias for useCounter. Numeric counter state with utility functions.AUTO
useObservableReact state hook that tracks the latest value of an Observable.EXTERNAL
usePreviousReact state hook that returns the previous state as described in the React hooks FAQAUTO
usePreviousDistinctJust like usePrevious but it will only update once the value actually changes. This is important wAUTO
useQueueReact state hook implements simple FIFO queue.AUTO
useRafStateReact state hook that only updates state in the callback of requestAnimationFrameAUTO
useRendersCountTracks component's renders count including the first render.AUTO
useSetReact state hook that tracks a SetAUTO
useSetStateReact state hook that creates setState method which works similar to howAUTO
useStateListProvides handles for circular iteration over states list.AUTO
useStateValidatorEach time given state changes - validator function is invoked.AUTO
useStateWithHistoryStores defined amount of previous state values and provides handles to travel through them.AUTO
useToggleReact state hook that tracks value of a boolean.AUTO

Miscellaneous

HookDescriptionInvocation
useEnsuredForwardedRefReact hook to use a ForwardedRef safely.AUTO

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.4%
按下载量换算39

Claude

32.55%
按下载量换算39

Cursor

18.98%
按下载量换算23

Gemini CLI

9.41%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills