withRuntime fix
All checks were successful
Lint / lint (push) Successful in 12s

This commit is contained in:
Julien Valverdé
2025-07-18 11:51:07 +02:00
parent 3cb0964a48
commit 4d99fb1cc1
2 changed files with 11 additions and 4 deletions

View File

@@ -331,13 +331,20 @@ export const withOptions: {
export const withRuntime: {
<E, R, P extends {}>(
context: React.Context<Runtime.Runtime<R>>,
): (self: Component<E, R | Scope.Scope, P>) => React.FC<P>
): (self: Component<E, R, P> & Suspense) => React.FC<P & SuspenseProps>
<E, R, P extends {}>(
self: Component<E, R | Scope.Scope, P>,
context: React.Context<Runtime.Runtime<R>>,
): (self: Component<E, R, P>) => React.FC<P>
<E, R, P extends {}>(
self: Component<E, R, P> & Suspense,
context: React.Context<Runtime.Runtime<R>>,
): React.FC<P & SuspenseProps>
<E, R, P extends {}>(
self: Component<E, R, P>,
context: React.Context<Runtime.Runtime<R>>,
): React.FC<P>
} = Function.dual(2, <E, R, P extends {}>(
self: Component<E, R | Scope.Scope, P>,
self: Component<E, R, P>,
context: React.Context<Runtime.Runtime<R>>,
): React.FC<P> => function WithRuntime(props) {
const runtime = React.useContext(context)