From 23242729a0125409131a3289ad490750b6f94830 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Wed, 31 May 2023 18:46:53 +0800 Subject: [PATCH] fix: change some safe navigation to null assertions --- src/component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/component.ts b/src/component.ts index c47e7fe..1e6e7d5 100644 --- a/src/component.ts +++ b/src/component.ts @@ -71,7 +71,7 @@ export const makeReactive = (component: T): T => { useEffect(() => { initializeRef(true); return () => { - reactivityRef.current?.scope.stop(); + reactivityRef.current!.scope.stop(); reactivityRef.current = null; }; // eslint-disable-next-line react-hooks/exhaustive-deps @@ -94,8 +94,8 @@ export const makeReactive = (component: T): T => { renderedComponents.set(fiber, reactivityRef.current!); } - return reactivityRef.current?.scope.run(() => - reactivityRef.current?.effect() + return reactivityRef.current!.scope.run(() => + reactivityRef.current!.effect() ); }) as T; reactiveFC.propTypes = component.propTypes;