Skip to content

Commit

Permalink
fix: avoid relying on implicit children prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed May 26, 2022
1 parent efd262c commit c11cefd
Show file tree
Hide file tree
Showing 4 changed files with 20,539 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,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
Loading

0 comments on commit c11cefd

Please sign in to comment.