Skip to content

Commit ea4551f

Browse files
author
oliver.phillips
committed
Fix incorrect react import
1 parent 25d3d38 commit ea4551f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ We'll be using [React Testing Library](https://testing-library.com/docs/react-te
115115
We can render our components to jsdom using RTL's [`render`](https://testing-library.com/docs/react-testing-library/api#render) method.
116116

117117
```jsx
118-
import React from "react-dom";
118+
import React from "react";
119119
import { render } from "react-testing-library";
120120
import Button from "./Button";
121121

@@ -129,7 +129,7 @@ test("The button renders", () => {
129129
The return value of `render` is an object with [useful methods](https://testing-library.com/docs/dom-testing-library/api-queries#queries) for finding elements on the page. You can destructure them out like this:
130130

131131
```jsx
132-
import React from "react-dom";
132+
import React from "react";
133133
import { render } from "react-testing-library";
134134
import Button from "./Button";
135135

@@ -154,8 +154,8 @@ We're trying to test components that _do stuff_ here, so we need a way to trigge
154154
Imagine the `Button` component we're testing changes its text from 'click me' to 'just clicked' when you click it.
155155

156156
```jsx
157-
import React from "react-dom";
158-
import { render } from "react-testing-library";
157+
import React from "react";
158+
import { render, fireEvent } from "react-testing-library";
159159
import Button from "./Button";
160160

161161
test("The button renders", () => {

0 commit comments

Comments
 (0)