Skip to content

Commit 017d389

Browse files
committed
revert: act docs
1 parent 6e163ec commit 017d389

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

docs/react-testing-library/api.mdx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,6 @@ All it does is forward all arguments to the act function if your version of
325325
react supports `act`. It is recommended to use the import from
326326
`@testing-library/react` over `react-dom/test-utils` for consistency reasons.
327327
328-
```typescript
329-
export const act: typeof reactAct extends undefined
330-
? (callback: () => void) => void
331-
: typeof reactAct
332-
```
333-
334328
## `renderHook`
335329
336330
This is a convenience wrapper around `render` with a custom test component. The
@@ -345,7 +339,7 @@ function renderHook<
345339
Props,
346340
Q extends Queries = typeof queries,
347341
Container extends Element | DocumentFragment = HTMLElement,
348-
BaseElement extends Element | DocumentFragment = Container,
342+
BaseElement extends Element | DocumentFragment = Container
349343
>(
350344
render: (initialProps: Props) => Result,
351345
options?: RenderHookOptions<Props, Q, Container, BaseElement>,
@@ -383,18 +377,20 @@ test('returns logged in user', () => {
383377
})
384378
```
385379
386-
> NOTE: When using `renderHook` in conjunction with the `wrapper` and `initialProps` options, the `initialProps` are not passed to the `wrapper` component.
387-
> To provide props to the `wrapper` component, consider a solution like this:
380+
> NOTE: When using `renderHook` in conjunction with the `wrapper` and
381+
> `initialProps` options, the `initialProps` are not passed to the `wrapper`
382+
> component. To provide props to the `wrapper` component, consider a solution
383+
> like this:
388384
>
389385
> ```js
390386
> const createWrapper = (Wrapper, props) => {
391387
> return function CreatedWrapper({ children }) {
392388
> return <Wrapper {...props}>{children}</Wrapper>;
393389
> };
394390
> };
395-
>
391+
>
396392
> ...
397-
>
393+
>
398394
> {
399395
> wrapper: createWrapper(Wrapper, { value: 'foo' }),
400396
> }
@@ -455,4 +451,4 @@ import {renderHook} from '@testing-library/react'
455451
const {unmount} = renderHook(({name = 'Alice'} = {}) => name)
456452

457453
unmount()
458-
```
454+
```

0 commit comments

Comments
 (0)