Skip to content

Commit a6bf3f5

Browse files
authored
New install instructions for RTL (#1384)
1 parent 93b87b8 commit a6bf3f5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/react-testing-library/intro.mdx

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@ sidebar_label: Introduction
77
[`React Testing Library`][gh] builds on top of `DOM Testing Library` by adding
88
APIs for working with React components.
99

10-
> Projects created with [`Create React App`](https://create-react-app.dev/) have
11-
> out of the box support for **React Testing Library**. If that is not the case,
12-
> you can add it via `npm` like so:
10+
## Installation
1311

1412
```bash npm2yarn
1513
npm install --save-dev @testing-library/react
1614
```
1715

18-
- [React Testing Library on GitHub][gh]
16+
### With TypeScript
17+
18+
To get full type coverage, you need to install the types for `react-dom` as well:
19+
20+
```bash npm2yarn
21+
npm install --save-dev @testing-library/react @types/react-dom
22+
```
23+
1924

2025
[gh]: https://github.com/testing-library/react-testing-library
2126

0 commit comments

Comments
 (0)