mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 12:13:11 +00:00
Explain where act comes from (#3237)
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user