Skip to content

Commit e33772b

Browse files
authored
feat: add RenderOptions type for easier migration from RTL (#27)
1 parent c4d78b7 commit e33772b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { beforeEach } from 'vitest'
33
import { cleanup, render } from './pure'
44

55
export { render, renderHook, cleanup } from './pure'
6-
export type { ComponentRenderOptions, RenderHookOptions, RenderHookResult, RenderResult } from './pure'
6+
export type { ComponentRenderOptions, RenderHookOptions, RenderHookResult, RenderOptions, RenderResult } from './pure'
77

88
page.extend({
99
render,

src/pure.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export interface ComponentRenderOptions {
4545
wrapper?: React.JSXElementConstructor<{ children: React.ReactNode }>
4646
}
4747

48+
export interface RenderOptions extends ComponentRenderOptions {}
49+
4850
// Ideally we'd just use a WeakMap where containers are keys and roots are values.
4951
// We use two variables so that we can bail out in constant time when we render with a new container (most common use case)
5052
const mountedContainers = new Set<Container>()

0 commit comments

Comments
 (0)