Skip to content
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
18 changes: 11 additions & 7 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,23 @@ export interface RenderOptions<
*
* @see {@link https://react.dev/reference/react-dom/client/createRoot#parameters createRoot#options}
*/
onCaughtError?: ReactDOMClient.RootOptions extends {
onCaughtError?: infer OnCaughtError
}
? OnCaughtError
: never
onCaughtError?:
| (ReactDOMClient.RootOptions extends {
onCaughtError?: infer OnCaughtError
}
? OnCaughtError
: never)
| undefined
/**
* Callback called when React automatically recovers from errors.
* Called with an error React throws, and an `errorInfo` object containing the `componentStack`.
* Some recoverable errors may include the original error cause as `error.cause`.
*
* @see {@link https://react.dev/reference/react-dom/client/createRoot#parameters createRoot#options}
*/
onRecoverableError?: ReactDOMClient.RootOptions['onRecoverableError']
onRecoverableError?:
| ReactDOMClient.RootOptions['onRecoverableError']
| undefined
/**
* Not supported at the moment
*/
Expand All @@ -160,7 +164,7 @@ export interface RenderOptions<
* When enabled, <StrictMode> is rendered around the inner element.
* If defined, overrides the value of `reactStrictMode` set in `configure`.
*/
reactStrictMode?: boolean
reactStrictMode?: boolean | undefined
}

type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
Expand Down
2 changes: 2 additions & 0 deletions types/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export function wrappedRender(
wrapper: Wrapper,
// testing exactOptionalPropertyTypes compatibility
hydrate: options?.hydrate,
reactStrictMode: options?.reactStrictMode,
onRecoverableError: options?.onRecoverableError,
...options,
})
}
Expand Down
Loading