[Notification] Fix error "Text strings must be rendered within a <Text> component" when title text is empty (#2247)

* Use ternary operator

* Change files
This commit is contained in:
lyzhan7 2022-10-18 15:08:49 -07:00 коммит произвёл GitHub
Родитель f5aafd7cef
Коммит 5ecc998996
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix error when title string is empty",
"packageName": "@fluentui-react-native/notification",
"email": "78454019+lyzhan7@users.noreply.github.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -79,7 +79,7 @@ export const Notification = compose<NotificationType>({
<Slots.root {...mergedProps}>
{icon && <Slots.icon {...iconProps} accessible={false} />}
<Slots.contentContainer accessible={true}>
{title && <Slots.title>{title}</Slots.title>}
{title ? <Slots.title>{title}</Slots.title> : null}
<Slots.message style={messageStyle}>{children}</Slots.message>
</Slots.contentContainer>
{onActionPress && <Slots.action {...notificationButtonProps} />}