@@ -341,14 +341,11 @@ export const withOptions: {
|
||||
|
||||
|
||||
export const useFC: {
|
||||
<E, R, P extends {}>(
|
||||
self: Component<E, R, P> & Suspense.Suspense
|
||||
): Effect.Effect<React.FC<P & Suspense.Suspense.Props>, never, Exclude<R, Scope.Scope>>
|
||||
<E, R, P extends {}>(
|
||||
self: Component<E, R, P>
|
||||
): Effect.Effect<React.FC<P>, never, Exclude<R, Scope.Scope>>
|
||||
} = Effect.fn("useFC")(function* <E, R, P extends {}>(
|
||||
self: Component<E, R, P> & (Memoized.Memoized<P> | Suspense.Suspense | {})
|
||||
self: Component<E, R, P>
|
||||
) {
|
||||
const runtimeRef = React.useRef<Runtime.Runtime<Exclude<R, Scope.Scope>>>(null!)
|
||||
runtimeRef.current = yield* Effect.runtime<Exclude<R, Scope.Scope>>()
|
||||
@@ -395,10 +392,6 @@ export const useFC: {
|
||||
})
|
||||
|
||||
export const use: {
|
||||
<E, R, P extends {}>(
|
||||
self: Component<E, R, P> & Suspense.Suspense,
|
||||
fn: (Component: React.FC<P & Suspense.Suspense.Props>) => React.ReactNode,
|
||||
): Effect.Effect<React.ReactNode, never, Exclude<R, Scope.Scope>>
|
||||
<E, R, P extends {}>(
|
||||
self: Component<E, R, P>,
|
||||
fn: (Component: React.FC<P>) => React.ReactNode,
|
||||
@@ -408,16 +401,9 @@ export const use: {
|
||||
})
|
||||
|
||||
export const withRuntime: {
|
||||
<T extends Component<any, R, any>, R>(
|
||||
context: React.Context<Runtime.Runtime<R>>,
|
||||
): (self: T) => React.FC<T extends Suspense.Suspense
|
||||
? Component.Props<T> & Suspense.Suspense.Props
|
||||
: Component.Props<T>
|
||||
>
|
||||
<E, R, P extends {}>(
|
||||
self: Component<E, R, P> & Suspense.Suspense,
|
||||
context: React.Context<Runtime.Runtime<R>>,
|
||||
): React.FC<P & Suspense.Suspense.Props>
|
||||
): (self: Component<E, R, P>) => React.FC<P>
|
||||
<E, R, P extends {}>(
|
||||
self: Component<E, R, P>,
|
||||
context: React.Context<Runtime.Runtime<R>>,
|
||||
|
||||
Reference in New Issue
Block a user