Fix `unstable_catchError` type inference for fallback props (#91485)
### Why?
TypeScript fails to infer the generic `P` from `Omit<P, 'children'>` in
the fallback function parameter.
```
Argument of type '(props: { title: string; }, { error, reset, unstable_retry }: ErrorInfo) => Element' is not assignable to parameter of type '(props: Omit<UserProps, "children">, errorInfo: ErrorInfo) => ReactNode'.
Types of parameters 'props' and 'props' are incompatible.
Property 'title' is missing in type 'Omit<UserProps, "children">' but required in type '{ title: string; }'.ts(2345)
catch-error-wrapper.tsx(7, 12): 'title' is declared here.
```
Showing
Please
register
or
sign in
to comment