Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid relying on implicit children prop #848

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,15 @@
"contributions": [
"doc"
]
},
{
"login": "Josh-Cena",
"name": "Joshua Chen",
"avatar_url": "https://avatars.githubusercontent.com/u/55398995?v=4",
"profile": "https://joshcena.com/",
"contributions": [
"code"
]
}
],
"skipCi": true,
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ library will instead be included as official additions to both `react-testing-li
([PR](https://github.com/callstack/react-native-testing-library/pull/923)) with the intention being
to provide a more cohesive and consistent implementation for our users.

Please be patient as we finalise these changes in the respective testing libraries.
In the mean time you can install `@testing-library/react@^13.1`
Please be patient as we finalise these changes in the respective testing libraries. In the mean time
you can install `@testing-library/react@^13.1`

## Table of Contents

Expand Down Expand Up @@ -263,6 +263,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://www.facebook.com/masoud.bonabi"><img src="https://avatars.githubusercontent.com/u/6429009?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Masious</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=masious" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Laishuxin"><img src="https://avatars.githubusercontent.com/u/56504759?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Laishuxin</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=Laishuxin" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://joshcena.com/"><img src="https://avatars.githubusercontent.com/u/55398995?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joshua Chen</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=Josh-Cena" title="Code">💻</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
Expand Down
8 changes: 6 additions & 2 deletions src/types/react.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentType } from 'react'
import { ComponentType, ReactNode } from 'react'

import {
RenderHookOptions as BaseRenderHookOptions,
Expand All @@ -8,7 +8,11 @@ import {
CleanupCallback
} from '.'

export type WrapperComponent<TProps> = ComponentType<TProps>
export type WrapperComponent<TProps> = ComponentType<
TProps & {
children: ReactNode
}
>

export type RendererOptions<TProps> = {
wrapper?: WrapperComponent<TProps>
Expand Down