From a9bcec0468e571f9a94ab2374fb6de4e78dadf0e Mon Sep 17 00:00:00 2001 From: Lingfan Gao Date: Wed, 30 Dec 2020 10:06:54 +0000 Subject: [PATCH 1/3] Remove default value for chat header slot --- .../fluentui/react-northstar/src/components/Chat/ChatMessage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx b/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx index 25d4568b80fde5..772f4bbeab263a 100644 --- a/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx +++ b/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx @@ -395,7 +395,6 @@ ChatMessage.displayName = 'ChatMessage'; ChatMessage.defaultProps = { accessibility: chatMessageBehavior, badgePosition: 'end', - header: {}, positionActionMenu: true, reactionGroupPosition: 'start', }; From edad8e791bf62d1b0662bbb7e340df1b14e5b296 Mon Sep 17 00:00:00 2001 From: Lingfan Gao Date: Wed, 30 Dec 2020 10:14:17 +0000 Subject: [PATCH 2/3] update changelog --- packages/fluentui/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/fluentui/CHANGELOG.md b/packages/fluentui/CHANGELOG.md index 82e4a9830c32fc..f407ee3246c10e 100644 --- a/packages/fluentui/CHANGELOG.md +++ b/packages/fluentui/CHANGELOG.md @@ -70,6 +70,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Add `unstable_disableTether` prop to configure `Popper`'s behavior for elements outside of a viewport @ling1726 @layershifter ([#16214](https://github.com/microsoft/fluentui/pull/16214)) - Fix Menu styles for `Toolbar` @TanelVari ([#16141](https://github.com/microsoft/fluentui/pull/16141)) - Fix missing export for `AttachmentBodyStylesProps` @ling1726 ([#16260](https://github.com/microsoft/fluentui/pull/16260)) +- Fix throwing error when using `ChatMessage` with children without declaring the `header` prop @ling1726 ([#16321](https://github.com/microsoft/fluentui/pull/16321)) ### Features - Add 2.0 light and dark themes @jurokapsiar ([#15867](https://github.com/microsoft/fluentui/pull/15867)) From 90b6392399c7b538c7eafdc962ab5e5f37277565 Mon Sep 17 00:00:00 2001 From: Lingfan Gao Date: Wed, 30 Dec 2020 10:18:44 +0000 Subject: [PATCH 3/3] Always render header slot --- .../react-northstar/src/components/Chat/ChatMessage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx b/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx index 772f4bbeab263a..c573db873831b6 100644 --- a/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx +++ b/packages/fluentui/react-northstar/src/components/Chat/ChatMessage.tsx @@ -342,7 +342,7 @@ export const ChatMessage: ComponentWithAs<'div', ChatMessageProps> & const readStatusElement = createShorthand(ChatMessageReadStatus, readStatus, {}); - const headerElement = createShorthand(ChatMessageHeader, header, { + const headerElement = createShorthand(ChatMessageHeader, header || {}, { overrideProps: () => ({ content: ( <>