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
Prefer using [`user.scrollTo`](docs/api/events/user-event#scrollto) over `fireEvent.scroll` for `ScrollView`, `FlatList`, and `SectionList` components. User Event provides a more realistic event simulation based on React Native runtime behavior.
171
171
:::
172
172
173
-
## `fireEventAsync`{#async}
173
+
## `fireEventAsync`{#fire-event-async}
174
174
175
175
:::info RNTL minimal version
176
176
@@ -186,7 +186,7 @@ async function fireEventAsync(
186
186
):Promise<unknown>;
187
187
```
188
188
189
-
The `fireEventAsync` function is the async version of `fireEvent` designed for working with React 19 and React Suspense. This function uses async `act` function internally to ensure all pending React updates are executed during event handling.
189
+
The `fireEventAsync` function is the async version of [`fireEvent`](#fire-event) designed for working with React 19 and React Suspense. This function uses async `act` function internally to ensure all pending React updates are executed during event handling.
Async version of `fireEvent.changeText` designed for React 19 and React Suspense. Use when `changeText` event handlers trigger suspense boundaries.
232
+
Async version of [`fireEvent.changeText`](#change-text) designed for React 19 and React Suspense. Use when `changeText` event handlers trigger suspense boundaries.
233
233
234
234
### `fireEventAsync.scroll`{#async-scroll}
235
235
@@ -244,4 +244,4 @@ fireEventAsync.scroll: (
244
244
) =>Promise<unknown>
245
245
```
246
246
247
-
Async version of `fireEvent.scroll` designed for React 19 and React Suspense. Use when `scroll` event handlers trigger suspense boundaries.
247
+
Async version of [`fireEvent.scroll`](#scroll) designed for React 19 and React Suspense. Use when `scroll` event handlers trigger suspense boundaries.
Copy file name to clipboardExpand all lines: website/docs/13.x/docs/api/render.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# `render`function
1
+
# `render`API
2
2
3
-
## `render`
3
+
## `render` function {#render}
4
4
5
5
```jsx
6
6
functionrender(
@@ -67,7 +67,7 @@ The `render` function returns the same queries and utilities as the [`screen`](d
67
67
68
68
See [this article](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen) from Kent C. Dodds for more details.
69
69
70
-
## `renderAsync` function
70
+
## `renderAsync` function{#render-async}
71
71
72
72
:::info RNTL minimal version
73
73
@@ -82,7 +82,7 @@ async function renderAsync(
82
82
):Promise<RenderAsyncResult>;
83
83
```
84
84
85
-
The `renderAsync` function is the async version of `render` designed for working with React 19 and React Suspense. This function uses async `act` function internally to ensure all pending React updates are executed during rendering.
85
+
The `renderAsync` function is the async version of [`render`](#render) designed for working with React 19 and React Suspense. This function uses async `act` function internally to ensure all pending React updates are executed during rendering.
Copy file name to clipboardExpand all lines: website/docs/13.x/docs/api/screen.mdx
+2-10Lines changed: 2 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,26 +46,22 @@ Re-render the in-memory tree with a new root element. This simulates a React upd
46
46
_Also available under `updateAsync` alias_
47
47
48
48
:::info RNTL minimal version
49
-
50
49
This API requires RNTL v13.3.0 or later.
51
-
52
50
:::
53
51
54
52
```ts
55
53
function rerenderAsync(element:React.Element<unknown>):Promise<void>;
56
54
```
57
55
58
-
Async versions of `rerender` designed for working with React 19 and React Suspense. This method uses async `act` function internally to ensure all pending React updates are executed during updating.
56
+
Async versions of [`rerender`](#rerender) designed for working with React 19 and React Suspense. This method uses async `act` function internally to ensure all pending React updates are executed during updating.
@@ -87,21 +83,17 @@ Usually you should not need to call `unmount` as it is done automatically if you
87
83
### `unmountAsync`
88
84
89
85
:::info RNTL minimal version
90
-
91
86
This API requires RNTL v13.3.0 or later.
92
-
93
87
:::
94
88
95
89
```ts
96
90
function unmountAsync():Promise<void>;
97
91
```
98
92
99
-
Async version of `unmount` designed for working with React 19 and React Suspense. This method uses async `act` function internally to ensure all pending React updates are executed during unmounting.
93
+
Async version of [`unmount`](#unmount) designed for working with React 19 and React Suspense. This method uses async `act` function internally to ensure all pending React updates are executed during unmounting.
100
94
101
95
:::note
102
-
103
96
Usually you should not need to call `unmountAsync` as it is done automatically if your test runner supports `afterEach` hook (like Jest, mocha, Jasmine).
0 commit comments