From 2ef47bed70f725478cd77497d7cdb69791f0c3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sun, 29 Jun 2025 23:00:33 +0200 Subject: [PATCH] Work --- packages/effect-components/src/ReactComponent.ts | 4 +++- packages/example/src/routes/effect-component-tests.tsx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/effect-components/src/ReactComponent.ts b/packages/effect-components/src/ReactComponent.ts index d02102a..adca7c7 100644 --- a/packages/effect-components/src/ReactComponent.ts +++ b/packages/effect-components/src/ReactComponent.ts @@ -20,7 +20,9 @@ export const useFC: { ) { const runtime = yield* Effect.runtime() - return React.useCallback((props: P) => Runtime.runSync(runtime)(self(props)), Array.from( + return React.useMemo(() => { + return (props: P) => Runtime.runSync(runtime)(self(props)) + }, Array.from( Context.omit(...nonReactiveTags)(runtime.context).unsafeMap.values() )) }) diff --git a/packages/example/src/routes/effect-component-tests.tsx b/packages/example/src/routes/effect-component-tests.tsx index 1a09eb9..8eb1c22 100644 --- a/packages/example/src/routes/effect-component-tests.tsx +++ b/packages/example/src/routes/effect-component-tests.tsx @@ -41,3 +41,4 @@ const MyTestComponent = Effect.fn(function* MyTestComponent(props?: { readonly v }) +console.log(MyTestComponent)