{"id":45538234,"url":"https://github.com/webeach/react-hooks","last_synced_at":"2026-02-23T02:57:39.804Z","repository":{"id":314746968,"uuid":"1056611932","full_name":"webeach/react-hooks","owner":"webeach","description":"A set of smart React hooks for performant UIs (React 18+)","archived":false,"fork":false,"pushed_at":"2026-01-12T14:29:31.000Z","size":537,"stargazers_count":25,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T21:10:57.212Z","etag":null,"topics":["ahooks","hooks","react","react-extensions","react-hooks","react-use","smart-hooks"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webeach.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-14T13:07:22.000Z","updated_at":"2026-01-02T00:52:44.000Z","dependencies_parsed_at":"2025-09-14T15:31:21.609Z","dependency_job_id":"3bac7be7-6e2a-406c-bb7c-8561fad3d689","html_url":"https://github.com/webeach/react-hooks","commit_stats":null,"previous_names":["webeach/react-hooks"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/webeach/react-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeach%2Freact-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeach%2Freact-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeach%2Freact-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeach%2Freact-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webeach","download_url":"https://codeload.github.com/webeach/react-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webeach%2Freact-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29735843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T02:24:00.660Z","status":"ssl_error","status_checked_at":"2026-02-23T02:22:56.087Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ahooks","hooks","react","react-extensions","react-hooks","react-use","smart-hooks"],"created_at":"2026-02-23T02:57:38.372Z","updated_at":"2026-02-23T02:57:39.795Z","avatar_url":"https://github.com/webeach.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"react-hooks\" src=\"./assets/logo.svg\" height=\"96\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@webeach/react-hooks\"\u003e\n       \u003cimg src=\"https://img.shields.io/npm/v/@webeach/react-hooks.svg?color=646fe1\u0026labelColor=9B7AEF\" alt=\"npm package\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/webeach/react-hooks/actions/workflows/ci.yml\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/webeach/react-hooks/ci.yml?color=646fe1\u0026labelColor=9B7AEF\" alt=\"build\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@webeach/react-hooks\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/dm/@webeach/react-hooks.svg?color=646fe1\u0026labelColor=9B7AEF\" alt=\"npm downloads\" /\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\u003ca href=\"./README.md\"\u003e🇺🇸 English version\u003c/a\u003e | \u003ca href=\"./README.ru.md\"\u003e🇷🇺 Русская версия\u003c/a\u003e\u003c/p\u003e\n  \u003cp\u003eA set of smart React hooks for performant UIs (React 18+)\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n## 💎 Highlights\n\n- **Fewer re-renders.** Hooks update state only when needed: lazy flags, stable handlers and refs.\n- **Hybrid return.** Many hooks can be used as a **tuple** or as an **object** — pick the shape you prefer.\n- **Clean effects.** Subscriptions and cleanup are sensible by default; behavior is predictable.\n- **SSR-ready.** Browser APIs are touched strictly inside effects.\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install @webeach/react-hooks\n```\n\nor\n\n```bash\npnpm install @webeach/react-hooks\n```\n\nor\n\n```bash\nyarn add @webeach/react-hooks\n```\n\n---\n\n## 📥 Import\n\n**ES Modules**\n\n```ts\nimport { useBoolean } from '@webeach/react-hooks/useBoolean';\nimport { useEffectCompare } from '@webeach/react-hooks/useEffectCompare';\nimport { useWindowEvent } from '@webeach/react-hooks/useWindowEvent';\n\n// or\nimport { useBoolean, useEffectCompare, useWindowEvent } from '@webeach/react-hooks';\n```\n\n**CommonJS**\n\n```ts\nconst { useBoolean } = require('@webeach/react-hooks/useBoolean');\nconst { useEffectCompare } = require('@webeach/react-hooks/useEffectCompare');\nconst { useWindowEvent } = require('@webeach/react-hooks/useWindowEvent');\n\n// or\nconst { useBoolean, useEffectCompare, useWindowEvent } = require('@webeach/react-hooks');\n```\n\n### 🌿 Tree‑shaking\n- Every hook is available as an **individual module path** (`@webeach/react-hooks/useX`). Importing this way pulls **only the code you need** — the most predictable and compact option for any bundler (ESM and CJS).\n- Named import from the package root (`@webeach/react-hooks`) supports tree‑shaking in bundlers that optimize **ES modules** (Vite/Rollup/esbuild/Webpack 5 in production). Unused exports will be removed at build time.\n- For **CommonJS** projects, we recommend per‑module imports (`require('@webeach/react-hooks/useX')`) to avoid pulling extra code through the index.\n\n---\n\n## 🛠 Hooks\n\n### Alphabetical\n\n+ [useAsyncCallback](./docs/en/useAsyncCallback.md)\n+ [useAsyncHandler](./docs/en/useAsyncHandler.md)\n+ [useBoolean](./docs/en/useBoolean.md)\n+ [useCallbackCompare](./docs/en/useCallbackCompare.md)\n+ [useCollection](./docs/en/useCollection.md)\n+ [useControlled](./docs/en/useControlled.md)\n+ [useDebounceCallback](./docs/en/useDebounceCallback.md)\n+ [useDebounceState](./docs/en/useDebounceState.md)\n+ [useDemandStructure](./docs/en/useDemandStructure.md)\n+ [useDeps](./docs/en/useDeps.md)\n+ [useDOMEvent](./docs/en/useDOMEvent.md)\n+ [useEffectCompare](./docs/en/useEffectCompare.md)\n+ [useForceUpdate](./docs/en/useForceUpdate.md)\n+ [useFrame](./docs/en/useFrame.md)\n+ [useFrameExtended](./docs/en/useFrameExtended.md)\n+ [useImageLoader](./docs/en/useImageLoader.md)\n+ [useIntersectionObserver](./docs/en/useIntersectionObserver.md)\n+ [useIsomorphicLayoutEffect](./docs/en/useIsomorphicLayoutEffect.md)\n+ [useLayoutEffectCompare](./docs/en/useLayoutEffectCompare.md)\n+ [useLiveRef](./docs/en/useLiveRef.md)\n+ [useLocalStorage](./docs/en/useLocalStorage.md)\n+ [useLoop](./docs/en/useLoop.md)\n+ [useMap](./docs/en/useMap.md)\n+ [useMediaQuery](./docs/en/useMediaQuery.md)\n+ [useMemoCompare](./docs/en/useMemoCompare.md)\n+ [useNumber](./docs/en/useNumber.md)\n+ [useOutsideEvent](./docs/en/useOutsideEvent.md)\n+ [usePageTitle](./docs/en/usePageTitle.md)\n+ [usePageVisibility](./docs/en/usePageVisibility.md)\n+ [usePatchDeepState](./docs/en/usePatchDeepState.md)\n+ [usePatchState](./docs/en/usePatchState.md)\n+ [useRefEffect](./docs/en/useRefEffect.md)\n+ [useRefState](./docs/en/useRefState.md)\n+ [useResizeObserver](./docs/en/useResizeObserver.md)\n+ [useSessionStorage](./docs/en/useSessionStorage.md)\n+ [useSet](./docs/en/useSet.md)\n+ [useStatus](./docs/en/useStatus.md)\n+ [useThrottleCallback](./docs/en/useThrottleCallback.md)\n+ [useThrottleState](./docs/en/useThrottleState.md)\n+ [useTimeout](./docs/en/useTimeout.md)\n+ [useTimeoutExtended](./docs/en/useTimeoutExtended.md)\n+ [useToggle](./docs/en/useToggle.md)\n+ [useUnmount](./docs/en/useUnmount.md)\n+ [useViewportBreakpoint](./docs/en/useViewportBreakpoint.md)\n+ [useWindowEvent](./docs/en/useWindowEvent.md)\n\n### By category\n\n#### State — simple primitives\n- [useControlled](./docs/en/useControlled.md)\n- [useBoolean](./docs/en/useBoolean.md)\n- [useNumber](./docs/en/useNumber.md)\n- [useToggle](./docs/en/useToggle.md)\n- [useStatus](./docs/en/useStatus.md)\n\n#### State — object patterns\n- [usePatchDeepState](./docs/en/usePatchDeepState.md)\n- [usePatchState](./docs/en/usePatchState.md)\n\n#### State — collections\n- [useCollection](./docs/en/useCollection.md)\n- [useMap](./docs/en/useMap.md)\n- [useSet](./docs/en/useSet.md)\n\n#### State — storage (persistence)\n- [useLocalStorage](./docs/en/useLocalStorage.md)\n- [useSessionStorage](./docs/en/useSessionStorage.md)\n\n#### Timers, loops \u0026 frames\n- [useFrame](./docs/en/useFrame.md)\n- [useFrameExtended](./docs/en/useFrameExtended.md)\n- [useLoop](./docs/en/useLoop.md)\n- [useTimeout](./docs/en/useTimeout.md)\n- [useTimeoutExtended](./docs/en/useTimeoutExtended.md)\n\n#### Rate limiting (throttle/debounce)\n- [useDebounceCallback](./docs/en/useDebounceCallback.md)\n- [useDebounceState](./docs/en/useDebounceState.md)\n- [useThrottleCallback](./docs/en/useThrottleCallback.md)\n- [useThrottleState](./docs/en/useThrottleState.md)\n\n#### Async operations\n- [useAsyncCallback](./docs/en/useAsyncCallback.md)\n- [useAsyncHandler](./docs/en/useAsyncHandler.md)\n- [useImageLoader](./docs/en/useImageLoader.md)\n\n#### Dependency optimization\n- [useDeps](./docs/en/useDeps.md)\n- [useCallbackCompare](./docs/en/useCallbackCompare.md)\n- [useEffectCompare](./docs/en/useEffectCompare.md)\n- [useLayoutEffectCompare](./docs/en/useLayoutEffectCompare.md)\n- [useMemoCompare](./docs/en/useMemoCompare.md)\n- [useIsomorphicLayoutEffect](./docs/en/useIsomorphicLayoutEffect.md)\n\n#### Lifecycle\n- [useEffectCompare](./docs/en/useEffectCompare.md)\n- [useLayoutEffectCompare](./docs/en/useLayoutEffectCompare.md)\n- [useUnmount](./docs/en/useUnmount.md)\n\n#### Refs\n- [useLiveRef](./docs/en/useLiveRef.md)\n- [useRefEffect](./docs/en/useRefEffect.md)\n\n#### Events\n- [useDOMEvent](./docs/en/useDOMEvent.md)\n- [useWindowEvent](./docs/en/useWindowEvent.md)\n- [useOutsideEvent](./docs/en/useOutsideEvent.md)\n\n#### Observers\n- [useIntersectionObserver](./docs/en/useIntersectionObserver.md)\n- [useResizeObserver](./docs/en/useResizeObserver.md)\n\n#### Page \u0026 document\n- [useMediaQuery](./docs/en/useMediaQuery.md)\n- [usePageTitle](./docs/en/usePageTitle.md)\n- [usePageVisibility](./docs/en/usePageVisibility.md)\n- [useViewportBreakpoint](./docs/en/useViewportBreakpoint.md)\n\n#### Utilities\n- [useDemandStructure](./docs/en/useDemandStructure.md)\n- [useForceUpdate](./docs/en/useForceUpdate.md)\n- [useRefState](./docs/en/useRefState.md)\n\n---\n\n## 🧩 Dependencies\n\nThis package has **a single external dependency** — [@webeach/collection](https://github.com/webeach/collection).\n\n- It is used **only** by the [`useCollection`](./docs/en/useCollection.md) hook.\n- Other hooks do not import or require `collection`.\n\n---\n\n## 🔖 Releasing\n\nReleases are automated with `semantic-release`.\n\nBefore publishing a new version, make sure that:\n\n1. All changes are committed and pushed to `main`.\n2. Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/):\n  - `feat: ...` — new features\n  - `fix: ...` — bug fixes\n  - `chore: ...`, `refactor: ...`, etc. — as needed\n3. The next version (`patch`, `minor`, `major`) is derived automatically from the commit types.\n\n---\n\n## 👤 Author\n\nDeveloped and maintained by [Ruslan Martynov](https://github.com/ruslan-mart).\n\nHave an idea or found a bug? Open an issue or send a pull request.\n\n---\n\n## 📄 License\n\nThis package is distributed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebeach%2Freact-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebeach%2Freact-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebeach%2Freact-hooks/lists"}