You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- re-rendering of component -`renderer.update` call
89
+
- re-rendering of component -`renderer.rerender` call
90
90
- triggering any event handlers that cause component tree render
91
91
92
-
Thankfully, for these basic cases RNTL has got you covered as our `render`, `update` and `fireEvent` methods already wrap their calls in `act` so that you do not have to do it explicitly.
92
+
Thankfully, for these basic cases RNTL has got you covered as our `render`, `rerender` and `fireEvent` methods already wrap their calls in `act` so that you do not have to do it explicitly.
93
93
94
94
Note that `act` calls can be safely nested and internally form a stack of calls. However, overlapping `act` calls, which can be achieved using async version of `act`, [are not supported](https://github.com/facebook/react/blob/main/packages/react/src/ReactAct.js#L161).
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/api/misc/other.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ function getQueriesForElement(element: HostElement): Queries {}
11
11
`within` (also available as `getQueriesForElement` alias) performs [queries](docs/api/queries) scoped to given element.
12
12
13
13
:::note
14
-
Please note that additional `render` specific operations like `update`, `unmount`, `debug`, `toJSON` are _not_ included.
14
+
Please note that additional `render` specific operations like `rerender`, `unmount`, `debug`, `toJSON` are _not_ included.
15
15
:::
16
16
17
17
```jsx
@@ -33,7 +33,7 @@ Use cases for scoped queries include:
33
33
function act<T>(callback: () =>T|Promise<T>):Promise<T>;
34
34
```
35
35
36
-
Useful function to help testing components that use hooks API. By default any `render`, `update`, `fireEvent`, and `waitFor` calls are wrapped by this function, so there is no need to wrap it manually.
36
+
Useful function to help testing components that use hooks API. By default any `render`, `rerender`, `fireEvent`, and `waitFor` calls are wrapped by this function, so there is no need to wrap it manually.
37
37
38
38
**In v14, `act` is now async by default and always returns a Promise**, making it compatible with React 19, React Suspense, and `React.use()`. This ensures all pending React updates are executed before the Promise resolves.
0 commit comments