# testing-library/react-hooks-testing-library

🐏 Simple and complete React hooks testing utilities that encourage good testing practices.

Repository: https://github.com/testing-library/react-hooks-testing-library
Canonical: https://ross.abutalabs.com/products/react-hooks-testing-library
Homepage: https://react-hooks-testing-library.com
Language: TypeScript
License: MIT
License Family: permissive
Topics: reactjs, testing, react-hooks, javascript, testing-library
Last push: 2024-01-30T20:25:46+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2853, "days_push": 946, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5259, forks 230 (observed 2026-08-28T04:09:13.810412+00:00)

## What it is
A Testing Library utility for testing React custom hooks by rendering them inside a test harness function component, with utilities like renderHook for updating inputs and asserting outputs. It supports react-test-renderer and react-dom renderers and is distributed as @testing-library/react-hooks.

## Use cases
- test custom react hooks without writing wrapper components
- unit test a react hook that manages complex state logic
- test a hook library that isn't tied to a specific component
- assert hook return values and rerender with new inputs
- test hooks that use effects, context, or async updates

## When to choose
- you're publishing a library of standalone custom hooks
- your hook is complex and hard to exercise through component tests
- you're on React 16.9–17 and need a dedicated hook test harness

## When to avoid
- you're on React 18+, where renderHook is built into @testing-library/react
- your hook is only used by one component and is easy to test via that component
- you want an actively developed tool - this library is deprecated

## Facets
- artifact type: library
- maturity: maintenance
- function: testing, mocking
- domain: testing, frontend, web-development, developer-tools
- platform: -
- tags: react, react-hooks, testing-library, unit-testing, custom-hooks, jest, deprecated, nodejs, javascript, web-server

## Member repositories
- testing-library/react-hooks-testing-library (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:13.810412+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:59:31.250401+00:00, confidence not recorded.
  - readme: https://github.com/testing-library/react-hooks-testing-library (fetched 2026-08-28T04:09:13.810412+00:00, sha a0850dc43657)
  - homepage: https://react-hooks-testing-library.com (fetched 2026-08-29T08:54:54.139557+00:00, sha bc674183ff80)
  - site_page: https://react-hooks-testing-library.com/installation (fetched 2026-08-29T08:54:54.148396+00:00, sha a105372e8c46)
  - registry_npm: https://registry.npmjs.org/react-hooks-testing-library (fetched 2026-08-29T08:54:54.150546+00:00, sha 0ae17dd72394)
- Data as of 2026-08-30T08:39:29.467469+00:00.
