@testing-library/react-hooks
8.0.1 · 18 Jun 2022MIT3M / weekRepositoryHomepagenpmAtom feed
37 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 8.x · latest line
8.0.0
10 Apr 2022- Breaking
types: type dependencies will not longer be automatically installed. If
@types/reactis not already listed in your package.json, please install it withnpm install --save-dev @types/react@^17. types: move types to optional peer dependencies
The “async-utils” feature of the
v8.0.0-alpha.1build (release notes) were not included in this release.
- 7.x
7.0.2
31 Aug 2021async-utils: prevent timeout and interval checks in wait from leaving open handles
7.0.1
30 Jun 2021types: fix
cleanupreturn type to matchasyncimplementation
- 6.x
6.0.0
18 May 2021- Breaking
Node 10 is no longer supported
Breaking changes
- Breaking
Node 10 is no longer supported
- 5.x
5.1.3
18 May 2021types: Correct overload order for act without strictNullChecks
5.1.1
29 Mar 2021Make library compatible with Node 8
5.0.3
24 Jan 2021Fixed potential error when hook suspends and error is accessed
5.0.0
13 Jan 2021- Breaking
intervalwill now default to 50ms in async utils - Breaking
timeoutwill now default to 1000ms in async utils - Breaking
suppressErrorshas been removed from async utils
Bug Fixes
Constrain TOptions to be an object instead of an empty interface
Display returned function names correctly in stack traces
Fixed potential error when hook suspends and current result is accessed
Include render utils in RenderHook type
ReactHooksRenderer renderHook was not expecting arguments
Stop appending container elements to document body
Type for options in autodetected renderer was incorrectly inferring any passed type
Use actual line break in error message when auto-detect fails
Features
react-dom and SSR compatible rendering
Use error boundary to capture useEffect errors (#539) (b81fd04), closes #308
Breaking changes
- Breaking
intervalwill now default to 50ms in async utils - Breaking
timeoutwill now default to 1000ms in async utils - Breaking
suppressErrorshas been removed from async utils - Breaking
Adjust types so that react renderer exports don't required extra generic parameter
- Breaking
Importing from
renderHookandactfrom@testing-library/react-hookswill now auto-detect which renderer to used based on the project's dependenciespeerDependenciesare now optional to support different dependencies being requiredThis means there will be no warning if the dependency is not installed at all, but it will still warn if an incompatible version is installed
Auto-detection won't work with bundlers (e.g. Webpack). Please use as specific renderer import instead
- Breaking
result.currentandresult.errorwill now returnundefinedinstead ofnullwhen the hook call suspends and they are accessed prior to being set for the first timeNote: accessing these values in a suspending scenario has been broken since version
3.6.0
- 4.x
4.0.1
12 Jan 2021Restore 'RenderHookOptions' type
4.0.0
7 Jan 2021- Breaking
Removed deprecated wait
types: changed callback signature on waitFor to match old types
Convert to TypeScript
- 3.x
3.7.0
8 Dec 2020cleanup: remove unnecessary flush microtasks as already handled by act
3.6.0
7 Dec 2020Reading the note…
3.5.0
6 Dec 2020Reading the note…
3.4.2
28 Sep 2020Reading the note…
3.4.1
23 Jul 2020Reading the note…
3.4.0
23 Jul 2020Reading the note…
3.3.0
4 Jun 2020Reading the note…
3.2.1
5 Nov 2019Reading the note…
3.2.0
5 Nov 2019Reading the note…
3.1.1
27 Oct 2019Reading the note…
3.1.0
17 Oct 2019Reading the note…
3.0.0
16 Oct 2019Reading the note…
- 2.x
2.0.3
3 Oct 2019Reading the note…
2.0.2
3 Oct 2019Reading the note…
2.0.1
9 Aug 2019Reading the note…
2.0.0
9 Aug 2019Reading the note…
- 1.x
1.1.0
30 Jun 2019Reading the note…
1.0.4
22 Jun 2019Reading the note…
1.0.3
21 Jun 2019Reading the note…
1.0.2
19 Jun 2019Reading the note…
1.0.1
19 Jun 2019Reading the note…
1.0.0
19 Jun 2019Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.