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
Invokes `scroll` event handler on the element or parent element in the tree.
279
319
@@ -519,40 +559,34 @@ A `RenderHookOptions<Props>` object to modify the execution of the `callback` fu
519
559
520
560
#### `initialProps`
521
561
522
-
The initial values to pass as `props` to the `callback` function of `renderHook`. The `Props` type is determined by the type passed to or inferred by the `renderHook` call.
562
+
The initial values to pass as `props` to the `callback` function of `renderHook`. The `Props` type is determined by the type passed to or inferred by the `renderHook` call.
523
563
524
564
#### `wrapper`
525
565
526
566
A React component to wrap the test component in when rendering. This is usually used to add context providers from `React.createContext` for the hook to access with `useContext`.
527
567
528
-
### `RenderHookResult<Result, Props>` object
568
+
### `RenderHookResult` object
569
+
570
+
```ts
571
+
interfaceRenderHookResult<Result, Props> {
572
+
result: { current:Result };
573
+
rerender: (props:Props) =>void;
574
+
unmount: () =>void;
575
+
}
576
+
```
529
577
530
578
The `renderHook` function returns an object that has the following properties:
531
579
532
580
#### `result`
533
581
534
-
```jsx
535
-
{
536
-
current: Result
537
-
}
538
-
```
539
-
540
-
The `current` value of the `result` will reflect the latest of whatever is returned from the `callback` passed to `renderHook`. The `Result` type is determined by the type passed to or inferred by the `renderHook` call.
582
+
The `current` value of the `result` will reflect the latest of whatever is returned from the `callback` passed to `renderHook`. The `Result` type is determined by the type passed to or inferred by the `renderHook` call.
541
583
542
584
#### `rerender`
543
585
544
-
```ts
545
-
function rerender(newProps?:Props):void;
546
-
```
547
-
548
-
A function to rerender the test component, causing any hooks to be recalculated. If `newProps` are passed, they will replace the `callback` function's `initialProps` for subsequent rerenders. The `Props` type is determined by the type passed to or inferred by the `renderHook` call.
586
+
A function to rerender the test component, causing any hooks to be recalculated. If `newProps` are passed, they will replace the `callback` function's `initialProps` for subsequent rerenders. The `Props` type is determined by the type passed to or inferred by the `renderHook` call.
549
587
550
588
#### `unmount`
551
589
552
-
```ts
553
-
function unmount():void;
554
-
```
555
-
556
590
A function to unmount the test component. This is commonly used to trigger cleanup effects for `useEffect` hooks.
> `getBy` queries are shown by default in the [query documentation](#queries)
@@ -55,7 +82,7 @@ type ReactTestInstance = {
55
82
56
83
### Options
57
84
58
-
Query first argument can be a **string** or a **regex**. Some queries accept optional argument which change string matching behaviour. See [TextMatch](#textmatch) for more info.
85
+
Usually query first argument can be a **string** or a **regex**. Some queries accept optional argument which change string matching behaviour. See [TextMatch](#textmatch) for more info.
0 commit comments