@@ -36,9 +36,10 @@ export type RenderResult<
3636 baseElement ?:
3737 | RendererableContainer
3838 | HydrateableContainer
39- | Array < RendererableContainer | HydrateableContainer > ,
40- maxLength ?: number ,
41- options ?: prettyFormat . OptionsReceived ,
39+ | Array < RendererableContainer | HydrateableContainer >
40+ | undefined ,
41+ maxLength ?: number | undefined ,
42+ options ?: prettyFormat . OptionsReceived | undefined ,
4243 ) => void
4344 rerender : ( ui : React . ReactNode ) => void
4445 unmount : ( ) => void
@@ -97,40 +98,40 @@ export interface RenderOptions<
9798 *
9899 * @see https://testing-library.com/docs/react-testing-library/api/#container
99100 */
100- container ?: Container
101+ container ?: Container | undefined
101102 /**
102103 * Defaults to the container if the container is specified. Otherwise `document.body` is used for the default. This is used as
103104 * the base element for the queries as well as what is printed when you use `debug()`.
104105 *
105106 * @see https://testing-library.com/docs/react-testing-library/api/#baseelement
106107 */
107- baseElement ?: BaseElement
108+ baseElement ?: BaseElement | undefined
108109 /**
109110 * If `hydrate` is set to `true`, then it will render with `ReactDOM.hydrate`. This may be useful if you are using server-side
110111 * rendering and use ReactDOM.hydrate to mount your components.
111112 *
112113 * @see https://testing-library.com/docs/react-testing-library/api/#hydrate)
113114 */
114- hydrate ?: boolean
115+ hydrate ?: boolean | undefined
115116 /**
116117 * Only works if used with React 18.
117118 * Set to `true` if you want to force synchronous `ReactDOM.render`.
118119 * Otherwise `render` will default to concurrent React if available.
119120 */
120- legacyRoot ?: boolean
121+ legacyRoot ?: boolean | undefined
121122 /**
122123 * Queries to bind. Overrides the default set from DOM Testing Library unless merged.
123124 *
124125 * @see https://testing-library.com/docs/react-testing-library/api/#queries
125126 */
126- queries ?: Q
127+ queries ?: Q | undefined
127128 /**
128129 * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating
129130 * reusable custom render functions for common data providers. See setup for examples.
130131 *
131132 * @see https://testing-library.com/docs/react-testing-library/api/#wrapper
132133 */
133- wrapper ?: React . JSXElementConstructor < { children : React . ReactNode } >
134+ wrapper ?: React . JSXElementConstructor < { children : React . ReactNode } > | undefined
134135}
135136
136137type Omit < T , K extends keyof T > = Pick < T , Exclude < keyof T , K > >
@@ -148,7 +149,7 @@ export function render<
148149) : RenderResult < Q , Container , BaseElement >
149150export function render (
150151 ui : React . ReactNode ,
151- options ?: Omit < RenderOptions , 'queries' > ,
152+ options ?: Omit < RenderOptions , 'queries' > | undefined ,
152153) : RenderResult
153154
154155export interface RenderHookResult < Result , Props > {
@@ -223,7 +224,7 @@ export interface RenderHookOptions<
223224 * The argument passed to the renderHook callback. Can be useful if you plan
224225 * to use the rerender utility to change the values passed to your hook.
225226 */
226- initialProps ?: Props
227+ initialProps ?: Props | undefined
227228}
228229
229230/**
@@ -238,7 +239,7 @@ export function renderHook<
238239 BaseElement extends RendererableContainer | HydrateableContainer = Container ,
239240> (
240241 render : ( initialProps : Props ) => Result ,
241- options ?: RenderHookOptions < Props , Q , Container , BaseElement > ,
242+ options ?: RenderHookOptions < Props , Q , Container , BaseElement > | undefined ,
242243) : RenderHookResult < Result , Props >
243244
244245/**
0 commit comments