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

react-useReact USE 搜索

Agent Skill

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

总安装

15,429

周安装

656

GitHub Stars

15

下载量

5,405
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于传感器、UI、动画、副作用、生命周期和状态管理的基本 React Hooks。

  • 30 多个传感器挂钩跟踪浏览器 API 和设备接口,包括地理位置、键盘输入、滚动位置、网络状态和设备运动
  • 9 个 UI 挂钩管理音频、视频、全屏、拖放、语音合成和点击检测
  • 8 个动画钩子提供 requestAnimationFrame 循环、间隔、超时、弹簧动态和补间
  • 16 个副作用挂钩处理异步操作、存储、剪贴板、去抖动、节流和浏览器 API(如 cookie 和 favicons)
  • 15 个生命周期钩子通过安装/卸载回调、深度比较效果和安装状态跟踪扩展了 React 的内置钩子
  • 超过 25 个状态挂钩通过历史记录和验证支持简化了布尔值、数组、映射、可观察值和自定义状态模式的管理

SKILL.md

react-use

The skill is based on react-use v17.6.0, generated at 2026-01-29.

react-use is a collection of essential React Hooks that provide ready-to-use functionality for common patterns in React applications. It includes hooks for sensors, UI interactions, animations, side-effects, lifecycle management, and state management.

Core References

TopicDescriptionReference
UsageImport patterns and tree-shaking recommendationscore-usage

Sensors

Sensor hooks listen to changes in browser APIs and device interfaces, forcing components to re-render with updated state.

TopicDescriptionReference
useBatteryTracks device battery statussensors-battery
useGeolocationTracks geo location state of user's devicesensors-geolocation
useHoverTracks mouse hover state of an elementsensors-hover
useHashTracks location hash valuesensors-hash
useIdleTracks whether user is being inactivesensors-idle
useIntersectionTracks an HTML element's intersectionsensors-intersection
useKeyTracks key pressessensors-key
useKeyPressTracks key press statesensors-key-press
useKeyPressEventHandles key press eventssensors-key-press-event
useKeyboardJsTracks keyboard key combinationssensors-keyboard-js
useLocationTracks page navigation bar location statesensors-location
useSearchParamTracks URL search parameterssensors-search-param
useLongPressTracks long press gesturesensors-long-press
useMediaTracks state of a CSS media querysensors-media
useMediaDevicesTracks state of connected hardware devicessensors-media-devices
useMotionTracks state of device's motion sensorsensors-motion
useMouseTracks state of mouse positionsensors-mouse
useMouseWheelTracks deltaY of scrolled mouse wheelsensors-mouse-wheel
useNetworkStateTracks browser's network connection statesensors-network-state
useOrientationTracks device's screen orientationsensors-orientation
usePageLeaveTriggers when mouse leaves page boundariessensors-page-leave
useScratchTracks mouse click-and-scrub statesensors-scratch
useScrollTracks an HTML element's scroll positionsensors-scroll
useScrollingTracks whether HTML element is scrollingsensors-scrolling
useStartTypingDetects when user starts typingsensors-start-typing
useWindowScrollTracks Window scroll positionsensors-window-scroll
useWindowSizeTracks Window dimensionssensors-window-size
useMeasureTracks an HTML element's dimensionssensors-measure
useSizeTracks element sizesensors-size
createBreakpointTracks innerWidth with breakpointssensors-breakpoint
useScrollbarWidthDetects browser's native scrollbars widthsensors-scrollbar-width
usePinchZoomTracks pointer events to detect pinch zoomsensors-pinch-zoom

UI

UI hooks allow you to control and subscribe to state changes of UI elements.

TopicDescriptionReference
useAudioPlays audio and exposes its controlsui-audio
useClickAwayTriggers callback when user clicks outside target areaui-click-away
useCssDynamically adjusts CSSui-css
useDropTracks file, link and copy-paste dropsui-drop
useFullscreenDisplay an element or video full-screenui-fullscreen
useSliderProvides slide behavior over any HTML elementui-slider
useSpeechSynthesizes speech from a text stringui-speech
useVibrateProvides physical feedback using Vibration APIui-vibrate
useVideoPlays video, tracks its state, and exposes playback controlsui-video

Animations

Animation hooks usually interpolate numeric values over time.

TopicDescriptionReference
useRafRe-renders component on each requestAnimationFrameanimations-raf
useIntervalRe-renders component on a set intervalanimations-interval
useHarmonicIntervalFnHarmonic interval functionanimations-harmonic-interval
useSpringInterpolates number over time according to spring dynamicsanimations-spring
useTimeoutRe-renders component after a timeoutanimations-timeout
useTimeoutFnCalls given function after a timeoutanimations-timeout-fn
useTweenRe-renders component while tweening a number from 0 to 1animations-tween
useUpdateReturns a callback which re-renders component when calledanimations-update

Side-effects

Side-effect hooks allow your app to trigger various side-effects using browser's API.

TopicDescriptionReference
useAsyncResolves an async functionside-effects-async
useAsyncFnAsync function with manual executionside-effects-async-fn
useAsyncRetryAsync function with retry capabilityside-effects-async-retry
useBeforeUnloadShows browser alert when user tries to reload or close the pageside-effects-before-unload
useCookieProvides way to read, update and delete a cookieside-effects-cookie
useCopyToClipboardCopies text to clipboardside-effects-copy-to-clipboard
useDebounceDebounces a functionside-effects-debounce
useErrorError dispatcherside-effects-error
useFaviconSets favicon of the pageside-effects-favicon
useLocalStorageManages a value in localStorageside-effects-local-storage
useSessionStorageManages a value in sessionStorageside-effects-session-storage
useLockBodyScrollLocks scrolling of the body elementside-effects-lock-body-scroll
useRafLoopCalls given function inside the RAF loopside-effects-raf-loop
useThrottleThrottles a functionside-effects-throttle
useThrottleFnThrottle function variantside-effects-throttle-fn
useTitleSets title of the pageside-effects-title
usePermissionQuery permission status for browser APIsside-effects-permission

Lifecycles

Lifecycle hooks modify and extend built-in React hooks or imitate React Class component lifecycle patterns.

TopicDescriptionReference
useEffectOnceModified useEffect that only runs oncelifecycles-effect-once
useEventSubscribe to eventslifecycles-event
useLifecyclesCalls mount and unmount callbackslifecycles-lifecycles
useMountedStateTracks if component is mountedlifecycles-mounted-state
useUnmountPromiseTrack if component is mounted with promise supportlifecycles-unmount-promise
usePromiseResolves promise only while component is mountedlifecycles-promise
useLoggerLogs in console as component goes through life-cycleslifecycles-logger
useMountCalls mount callbackslifecycles-mount
useUnmountCalls unmount callbackslifecycles-unmount
useUpdateEffectRun an effect only on updateslifecycles-update-effect
useIsomorphicLayoutEffectuseLayoutEffect that works on serverlifecycles-isomorphic-layout-effect
useDeepCompareEffectuseEffect with deep comparisonlifecycles-deep-compare-effect
useShallowCompareEffectuseEffect with shallow comparisonlifecycles-shallow-compare-effect
useCustomCompareEffectuseEffect with custom comparison functionlifecycles-custom-compare-effect

State

State hooks allow you to easily manage state of booleans, arrays, and maps.

TopicDescriptionReference
createMemoFactory of memoized hooksstate-create-memo
createReducerFactory of reducer hooks with custom middlewarestate-create-reducer
createReducerContextFactory of hooks for sharing state between componentsstate-create-reducer-context
createStateContextFactory of hooks for sharing state between componentsstate-create-state-context
createGlobalStateCross component shared statestate-create-global-state
useDefaultReturns the default value when state is null or undefinedstate-default
useGetSetReturns state getter get() instead of raw statestate-get-set
useGetSetStateCombination of useGetSet and useSetStatestate-get-set-state
useLatestReturns the latest state or propsstate-latest
usePreviousReturns the previous state or propsstate-previous
usePreviousDistinctLike usePrevious but with a predicatestate-previous-distinct
useObservableTracks latest value of an Observablestate-observable
useRafStateCreates setState method which only updates after requestAnimationFramestate-raf-state
useSetStateCreates setState method which works like this.setStatestate-set-state
useToggleTracks state of a booleanstate-toggle
useCounterTracks state of a numberstate-counter
useListTracks state of an arraystate-list
useMapTracks state of an objectstate-map
useSetTracks state of a Setstate-set
useQueueImplements simple queuestate-queue
useStateListCircularly iterates over an arraystate-state-list
useStateValidatorValidates state with a validator functionstate-state-validator
useStateWithHistoryStores previous state values and provides handles to travel through themstate-state-with-history
useMultiStateValidatorAlike useStateValidator but tracks multiple statesstate-multi-state-validator
useMediatedStateLike regular useState but with mediation by custom functionstate-mediated-state
useFirstMountStateCheck if current render is firststate-first-mount-state
useRendersCountCount component rendersstate-renders-count
useMethodsNeat alternative to useReducerstate-methods

Miscellaneous

TopicDescriptionReference
useEnsuredForwardedRefUse a React.forwardedRef safelymisc-ensured-forwarded-ref

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

33.05%
按下载量换算1,786

Claude

28.55%
按下载量换算1,543

Cursor

19.23%
按下载量换算1,039

Gemini CLI

9.89%
按下载量换算535

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills