diff --git a/packages/effect-fc/src/Component.ts b/packages/effect-fc/src/Component.ts index 1ac25c1..6c36f5e 100644 --- a/packages/effect-fc/src/Component.ts +++ b/packages/effect-fc/src/Component.ts @@ -56,7 +56,7 @@ const ComponentProto = Object.freeze({ const runtimeRef = React.useRef>>(null!) runtimeRef.current = yield* Effect.runtime>() - return React.useCallback(function ScopeProvider(props: P) { + return React.useRef(function ScopeProvider(props: P) { const scope = Runtime.runSync(runtimeRef.current)(Hooks.useScope( Array.from( Context.omit(...nonReactiveTags)(runtimeRef.current.context).unsafeMap.values() @@ -73,7 +73,7 @@ const ComponentProto = Object.freeze({ }, [scope]) return React.createElement(FC, props) - }, []) + }).current }), makeFunctionComponent

(