Skip to content

Commit

Permalink
fix: change some safe navigation to null assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed May 31, 2023
1 parent eb0178a commit 2324272
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const makeReactive = <T extends React.FC>(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
Expand All @@ -94,8 +94,8 @@ export const makeReactive = <T extends React.FC>(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;
Expand Down

0 comments on commit 2324272

Please sign in to comment.