Browse Source

Explain where act comes from (#3237)

Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
main
Toru Kobayashi 4 years ago
committed by GitHub
parent
commit
da8ef8b0f6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      content/docs/testing-recipes.md

2
content/docs/testing-recipes.md

@ -57,7 +57,7 @@ You may use a different pattern, but keep in mind that we want to execute the cl
### `act()` {#act}
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called `act()` that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. `react-dom/test-utils` provides a helper called [`act()`](/docs/test-utils.html#act) that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
```js
act(() => {

Loading…
Cancel
Save