@@ -56,7 +56,7 @@ const ComponentProto = Object.freeze({
|
|||||||
const runtimeRef = React.useRef<Runtime.Runtime<Exclude<R, Scope.Scope>>>(null!)
|
const runtimeRef = React.useRef<Runtime.Runtime<Exclude<R, Scope.Scope>>>(null!)
|
||||||
runtimeRef.current = yield* Effect.runtime<Exclude<R, Scope.Scope>>()
|
runtimeRef.current = yield* Effect.runtime<Exclude<R, Scope.Scope>>()
|
||||||
|
|
||||||
return React.useCallback(function ScopeProvider(props: P) {
|
return React.useRef(function ScopeProvider(props: P) {
|
||||||
const scope = Runtime.runSync(runtimeRef.current)(Hooks.useScope(
|
const scope = Runtime.runSync(runtimeRef.current)(Hooks.useScope(
|
||||||
Array.from(
|
Array.from(
|
||||||
Context.omit(...nonReactiveTags)(runtimeRef.current.context).unsafeMap.values()
|
Context.omit(...nonReactiveTags)(runtimeRef.current.context).unsafeMap.values()
|
||||||
@@ -73,7 +73,7 @@ const ComponentProto = Object.freeze({
|
|||||||
}, [scope])
|
}, [scope])
|
||||||
|
|
||||||
return React.createElement(FC, props)
|
return React.createElement(FC, props)
|
||||||
}, [])
|
}).current
|
||||||
}),
|
}),
|
||||||
|
|
||||||
makeFunctionComponent<P extends {}, A extends React.ReactNode, E, R>(
|
makeFunctionComponent<P extends {}, A extends React.ReactNode, E, R>(
|
||||||
|
|||||||
Reference in New Issue
Block a user