Skip to content

Commit 2106b0c

Browse files
committed
tweaks
1 parent d3e1246 commit 2106b0c

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

website/docs/13.x/docs/api/events/fire-event.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fireEvent.scroll(screen.getByText('scroll-view'), eventData);
170170
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.
171171
:::
172172

173-
## `fireEventAsync` {#async}
173+
## `fireEventAsync` {#fire-event-async}
174174

175175
:::info RNTL minimal version
176176

@@ -186,7 +186,7 @@ async function fireEventAsync(
186186
): Promise<unknown>;
187187
```
188188

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.
190190

191191
```jsx
192192
import { renderAsync, screen, fireEventAsync } from '@testing-library/react-native';
@@ -214,7 +214,7 @@ fireEventAsync.press: (
214214
) => Promise<unknown>
215215
```
216216

217-
Async version of `fireEvent.press` designed for React 19 and React Suspense. Use when `press` event handlers trigger suspense boundaries.
217+
Async version of [`fireEvent.press`](#press) designed for React 19 and React Suspense. Use when `press` event handlers trigger suspense boundaries.
218218

219219
### `fireEventAsync.changeText` {#async-change-text}
220220

@@ -229,7 +229,7 @@ fireEventAsync.changeText: (
229229
) => Promise<unknown>
230230
```
231231

232-
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.
233233

234234
### `fireEventAsync.scroll` {#async-scroll}
235235

@@ -244,4 +244,4 @@ fireEventAsync.scroll: (
244244
) => Promise<unknown>
245245
```
246246

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.

website/docs/13.x/docs/api/render.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# `render` function
1+
# `render` API
22

3-
## `render`
3+
## `render` function {#render}
44

55
```jsx
66
function render(
@@ -67,7 +67,7 @@ The `render` function returns the same queries and utilities as the [`screen`](d
6767

6868
See [this article](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen) from Kent C. Dodds for more details.
6969

70-
## `renderAsync` function
70+
## `renderAsync` function {#render-async}
7171

7272
:::info RNTL minimal version
7373

@@ -82,7 +82,7 @@ async function renderAsync(
8282
): Promise<RenderAsyncResult>;
8383
```
8484

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.
8686

8787
```jsx
8888
import { renderAsync, screen } from '@testing-library/react-native';

website/docs/13.x/docs/api/screen.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,22 @@ Re-render the in-memory tree with a new root element. This simulates a React upd
4646
_Also available under `updateAsync` alias_
4747

4848
:::info RNTL minimal version
49-
5049
This API requires RNTL v13.3.0 or later.
51-
5250
:::
5351

5452
```ts
5553
function rerenderAsync(element: React.Element<unknown>): Promise<void>;
5654
```
5755

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.
5957

6058
```jsx
6159
import { renderAsync, screen } from '@testing-library/react-native';
6260

6361
test('async rerender test', async () => {
6462
await renderAsync(<MyComponent initialData="first" />);
6563

66-
// Use async rerender when component has suspense or async behavior
6764
await screen.rerenderAsync(<MyComponent initialData="updated" />);
68-
6965
expect(screen.getByText('updated')).toBeOnTheScreen();
7066
});
7167
```
@@ -87,21 +83,17 @@ Usually you should not need to call `unmount` as it is done automatically if you
8783
### `unmountAsync`
8884

8985
:::info RNTL minimal version
90-
9186
This API requires RNTL v13.3.0 or later.
92-
9387
:::
9488

9589
```ts
9690
function unmountAsync(): Promise<void>;
9791
```
9892

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.
10094

10195
:::note
102-
10396
Usually you should not need to call `unmountAsync` as it is done automatically if your test runner supports `afterEach` hook (like Jest, mocha, Jasmine).
104-
10597
:::
10698

10799
### `debug`

0 commit comments

Comments
 (0)