RE

React Hooks

@testing-library/react-hooks

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

Testing
testing
react
hooks
unit
integration
@testing-library/react-hooks
javascript
npm
frontend
open source
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB

Installation

npm install @testing-library/react-hooks

Code example

import { Hooks } from "@testing-library/react-hooks";

export function Example() {
  return (
    <div>
      <h2>React Hooks</h2>
      <Hooks />
    </div>
  );
}

Pros & cons

Pros

  • Actively maintained by Michael Peyper
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 0 open issues on GitHub

FAQs

Alternatives & similar libraries