Skip to content

Commit 578faa9

Browse files
authored
fix: Handle the case when prop children is undefined in MenuItemAction component (#1226)
[CLNP-5329](https://sendbird.atlassian.net/browse/CLNP-5329) [SBISSUE-17339](https://sendbird.atlassian.net/browse/SBISSUE-17339) ### ChangeLog - Fixed an error message on MenuItemAction when the children prop is undefined ### fix - Handle the case when prop children is undefined in MenuItemAction comp
1 parent 8db4063 commit 578faa9

File tree

1 file changed

+8
-5
lines changed
  • src/modules/ChannelSettings/components/ChannelSettingsUI

1 file changed

+8
-5
lines changed

src/modules/ChannelSettings/components/ChannelSettingsUI/MenuItem.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,22 @@ export const MenuItemAction = ({
6464
accordionOpened,
6565
children,
6666
}: MenuItemActionProps) => {
67-
68-
return useAccordion
69-
? <Icon
67+
if (useAccordion) {
68+
return (
69+
<Icon
7070
type={IconTypes.CHEVRON_RIGHT}
7171
className={[
7272
'sendbird-accordion__panel-icon-right',
7373
'sendbird-accordion__panel-icon--chevron',
74-
(accordionOpened ? 'sendbird-accordion__panel-icon--open' : ''),
74+
accordionOpened ? 'sendbird-accordion__panel-icon--open' : '',
7575
].join(' ')}
7676
height="24px"
7777
width="24px"
7878
/>
79-
: children;
79+
);
80+
}
81+
82+
return children || null;
8083
};
8184

8285
export default MenuItem;

0 commit comments

Comments
 (0)