From 7395d090a166d967ae6a5169d920c8ecc63e0bc7 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Mon, 22 Apr 2024 14:42:50 +0200 Subject: [PATCH] New install instructions for RTL --- docs/react-testing-library/intro.mdx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/react-testing-library/intro.mdx b/docs/react-testing-library/intro.mdx index bf5c4ffda..9cf2a553e 100644 --- a/docs/react-testing-library/intro.mdx +++ b/docs/react-testing-library/intro.mdx @@ -7,15 +7,20 @@ sidebar_label: Introduction [`React Testing Library`][gh] builds on top of `DOM Testing Library` by adding APIs for working with React components. -> Projects created with [`Create React App`](https://create-react-app.dev/) have -> out of the box support for **React Testing Library**. If that is not the case, -> you can add it via `npm` like so: +## Installation ```bash npm2yarn npm install --save-dev @testing-library/react ``` -- [React Testing Library on GitHub][gh] +### With TypeScript + +To get full type coverage, you need to install the types for `react-dom` as well: + +```bash npm2yarn +npm install --save-dev @testing-library/react @types/react-dom +``` + [gh]: https://github.com/testing-library/react-testing-library