From 8e3d9850d7c4b14413c1ac69a030bbe3d4d0d791 Mon Sep 17 00:00:00 2001 From: webbrain-one <295484252+webbrain-one@users.noreply.github.com> Date: Fri, 14 Aug 2026 14:14:46 +0300 Subject: [PATCH] fix: prevent If component from rendering when is is falsy Explicitly return null when the is prop is falsy to fix TypeScript type inference errors and ensure children are only rendered when the condition is truthy. --- src/lib/If/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/If/index.tsx b/src/lib/If/index.tsx index b1512af..2ae5ed8 100644 --- a/src/lib/If/index.tsx +++ b/src/lib/If/index.tsx @@ -5,8 +5,8 @@ interface TypeProps { is: boolean; } -function If({ is, children }: TypeProps): JSX.Element { - return <>{is ? children : null}; +function If({ is, children }: TypeProps): React.ReactNode { + return is ? children : null; } export default If;