Skip to content

Commit 777bf4a

Browse files
committed
fix(BannerBase): treat boolean ReactNode as empty to avoid incorrect spacing when title/description/children are false
1 parent 694a8ed commit 777bf4a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/design-system-react-native/src/components/BannerBase/BannerBase.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const isTextContent = (content: React.ReactNode): content is string | number =>
2222
typeof content === 'string' || typeof content === 'number';
2323

2424
const hasContent = (content: React.ReactNode) =>
25-
content !== null && content !== undefined;
25+
content !== null && content !== undefined && typeof content !== 'boolean';
2626

2727
export const BannerBase: React.FC<BannerBaseProps> = ({
2828
title,

packages/design-system-react/src/components/BannerBase/BannerBase.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const isTextContent = (content: React.ReactNode): content is string | number =>
2222
typeof content === 'string' || typeof content === 'number';
2323

2424
const hasContent = (content: React.ReactNode) =>
25-
content !== null && content !== undefined;
25+
content !== null && content !== undefined && typeof content !== 'boolean';
2626

2727
export const BannerBase = forwardRef<HTMLDivElement, BannerBaseProps>(
2828
(

0 commit comments

Comments
 (0)