Skip to content

React 18 cleanup #819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%2Fgithub.com%2Ftesting-library%2Freact-hooks-testing-library%20%F0%9F%91%8D)
<!-- prettier-ignore-end -->

## 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

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ route: '/'

<hr />

## 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
Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
},
Expand Down