Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5833132

Browse files
committed
fix: Update 'onCaughtError' type inference in 'RenderOptions' to work with React v19
1 parent 9fc6a75 commit 5833132

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

‎types/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export interface RenderOptions<
127127
* @see {@link https://react.dev/reference/react-dom/client/createRoot#parameters createRoot#options}
128128
*/
129129
onCaughtError?: ReactDOMClient.RootOptions extends {
130-
onCaughtError: infer OnCaughtError
130+
onCaughtError?: infer OnCaughtError
131131
}
132132
? OnCaughtError
133133
: never

‎types/test.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ export function testErrorHandlers() {
268268
render(null, {
269269
// Should work with React 19 types
270270
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
271-
// @ts-expect-error
272271
onCaughtError: () => {},
273272
})
274273
render(null, {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /