title | author | authorURL |
---|---|---|
React Hooks Are Supported |
Alex Krolick |
Hooks have been released in React 16.8
and they are supported out of the box by react-testing-library
!
Because react-testing-library
only uses the external interface of your React
components, hooks work right away! If you rewrite a class component with hooks
your tests should still pass.
For unit testing custom hooks, we've also added a testHook
utility. Check out
the docs for testHook
. Thanks to
@donavon for the PR.