From 19ac8dde5c16f53d963277543997fa7a7ffd5fe4 Mon Sep 17 00:00:00 2001 From: Michael Peyper Date: Sun, 10 Apr 2022 20:29:22 +1000 Subject: [PATCH 1/3] fix(types): move types to optional peer dependencies BREAKING CHANGE: type dependencies will not longer be automatically installed. If @types/react is not already listed in your package.json, please install it with `npm install --save-dev @types/react@^17`. --- package.json | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 4f398a30..0b89d6eb 100644 --- a/package.json +++ b/package.json @@ -50,17 +50,17 @@ }, "dependencies": { "@babel/runtime": "^7.12.5", - "@types/react": ">=16.9.0", - "@types/react-dom": ">=16.9.0", - "@types/react-test-renderer": ">=16.9.0", "react-error-boundary": "^3.1.0" }, "devDependencies": { + "@types/react": "17.0.44", + "@types/react-dom": "17.0.15", + "@types/react-test-renderer": "17.0.1", "@typescript-eslint/eslint-plugin": "5.11.0", "@typescript-eslint/parser": "5.11.0", "all-contributors-cli": "6.20.0", "codecov": "3.8.3", - "cross-env": "^7.0.3", + "cross-env": "7.0.3", "docz": "2.3.1", "docz-theme-default": "1.2.0", "docz-utils": "2.3.0", @@ -75,11 +75,15 @@ "typescript": "4.5.5" }, "peerDependencies": { - "react": ">=16.9.0", - "react-dom": ">=16.9.0", - "react-test-renderer": ">=16.9.0" + "@types/react": "^16.9.0 || ^17.0.0", + "react": "^16.9.0 || ^17.0.0", + "react-dom": "^16.9.0 || ^17.0.0", + "react-test-renderer": "^16.9.0 || ^17.0.0" }, "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, "react-dom": { "optional": true }, From a267f1e7b7ac8b89bf7d809f25bd94faf850b727 Mon Sep 17 00:00:00 2001 From: Michael Peyper Date: Sun, 10 Apr 2022 20:39:27 +1000 Subject: [PATCH 2/3] chore(docs): add note about React 18 support --- README.md | 17 ++++++++++++++--- docs/introduction.md | 11 +++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc95d837..a903beb5 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,17 @@ [![Tweet](https://img.shields.io/twitter/url/https/github.com/testing-library/react-hooks-testing-library.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20react-hooks-testing-library%20by%20%40testing-library%20https%3A%2F%2Fproxy.goincop1.workers.dev%3A443%2Fhttps%2Fgithub.com%2Ftesting-library%2Freact-hooks-testing-library%20%F0%9F%91%8D) +## A Note about React 18 Support + +As part of the changes for React 18, it has been decided that the `renderHook` API provided by this +library will instead be included as official additions to both `react-testing-library` +([PR](https://github.com/testing-library/react-testing-library/pull/991)) and +`react-native-testing-library` +([PR](https://github.com/callstack/react-native-testing-library/pull/923)) with the intention being +to provide a more cohesive and consistent implementation for our users. + +Please be patient as we finalise these changes in the respective testing libraries. + ## Table of Contents @@ -146,9 +157,9 @@ to test against. It also does not come installed with a specific renderer, we cu [`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer) and [`react-dom`](https://www.npmjs.com/package/react-dom). You only need to install one of them, however, if you do have both installed, we will use `react-test-renderer` as the default. For more -information see the [installation docs](https://react-hooks-testing-library.com/installation#renderer). -Generally, the installed versions for `react` and the selected renderer should have matching -versions: +information see the +[installation docs](https://react-hooks-testing-library.com/installation#renderer). Generally, the +installed versions for `react` and the selected renderer should have matching versions: ```sh npm install react@^16.9.0 diff --git a/docs/introduction.md b/docs/introduction.md index de33732a..34467e3e 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -23,6 +23,17 @@ route: '/'
+## A Note about React 18 Support + +As part of the changes for React 18, it has been decided that the `renderHook` API provided by this +library will instead be included as official additions to both `react-testing-library` +([PR](https://github.com/testing-library/react-testing-library/pull/991)) and +`react-native-testing-library` +([PR](https://github.com/callstack/react-native-testing-library/pull/923)) with the intention being +to provide a more cohesive and consistent implementation for our users. + +Please be patient as we finalise these changes in the respective testing libraries. + ## The problem You're writing an awesome custom hook and you want to test it, but as soon as you call it you see From fcb9a71773b1a26a399e5427919a125bba905faa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Apr 2022 12:09:25 +0000 Subject: [PATCH 3/3] chore(deps-dev): bump docz-utils from 2.3.0 to 2.4.0 Bumps [docz-utils](https://github.com/doczjs/docz/tree/HEAD/core/docz-utils) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/doczjs/docz/releases) - [Changelog](https://github.com/doczjs/docz/blob/main/core/docz-utils/CHANGELOG.md) - [Commits](https://github.com/doczjs/docz/commits/v2.4.0/core/docz-utils) --- updated-dependencies: - dependency-name: docz-utils dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b89d6eb..8516eb9e 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "cross-env": "7.0.3", "docz": "2.3.1", "docz-theme-default": "1.2.0", - "docz-utils": "2.3.0", + "docz-utils": "2.4.0", "eslint": "7.32.0", "get-pkg-repo": "4.1.1", "kcd-scripts": "11.2.2",