Skip to content

Commit

Permalink
Update types to support all possible react component return values
Browse files Browse the repository at this point in the history
  • Loading branch information
trappar committed Feb 1, 2024
1 parent 4509fb6 commit 09dac30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export type RenderResult<
maxLength?: number,
options?: prettyFormat.OptionsReceived,
) => void
rerender: (ui: React.ReactElement) => void
rerender: (ui: React.ReactNode) => void
unmount: () => void
asFragment: () => DocumentFragment
} & {[P in keyof Q]: BoundFunction<Q[P]>}
Expand Down Expand Up @@ -90,7 +90,7 @@ export interface RenderOptions<
*
* @see https://testing-library.com/docs/react-testing-library/api/#wrapper
*/
wrapper?: React.JSXElementConstructor<{children: React.ReactElement}>
wrapper?: React.JSXElementConstructor<{children: React.ReactNode}>
}

type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
Expand All @@ -103,11 +103,11 @@ export function render<
Container extends Element | DocumentFragment = HTMLElement,
BaseElement extends Element | DocumentFragment = Container,
>(
ui: React.ReactElement,
ui: React.ReactNode,
options: RenderOptions<Q, Container, BaseElement>,
): RenderResult<Q, Container, BaseElement>
export function render(
ui: React.ReactElement,
ui: React.ReactNode,
options?: Omit<RenderOptions, 'queries'>,
): RenderResult

Expand Down

0 comments on commit 09dac30

Please sign in to comment.