Skip to content

Commit 85a2998

Browse files
committed
react-native(HeaderRoot): render title row when only titleAccessory is provided; preserve title===false guard
1 parent 96b0c4a commit 85a2998

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • packages/design-system-react-native/src/components/HeaderRoot

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import { useSafeAreaInsets } from 'react-native-safe-area-context';
44

55
// External dependencies.
6+
import { isReactNodeRenderable } from '@metamask/design-system-shared';
67
import { Box, BoxAlignItems, BoxFlexDirection } from '../Box';
78
import { BoxRow } from '../BoxRow';
89
import { ButtonIcon, ButtonIconSize } from '../ButtonIcon';
@@ -49,7 +50,10 @@ export const HeaderRoot = ({
4950
if (children) {
5051
return children;
5152
}
52-
if (title) {
53+
const hasTitleContent =
54+
title !== false &&
55+
(isReactNodeRenderable(title) || isReactNodeRenderable(titleAccessory));
56+
if (hasTitleContent) {
5357
return (
5458
<BoxRow
5559
endAccessory={titleAccessory}

0 commit comments

Comments
 (0)