Skip to content

Commit

Permalink
fix(slots): 更多组件取值容错
Browse files Browse the repository at this point in the history
  • Loading branch information
KuangPF committed Jul 19, 2023
1 parent 219ace8 commit 3a7b215
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/slots/Header/More.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const getMoreLinksGroup = (moreLinks: IMoreLink[]): MenuProps['items'] =>
};

const More: React.FC = () => {
const moreLinks = useLocaleValue('moreLinks');
return moreLinks.length > 0 ? (
const moreLinks = useLocaleValue('moreLinks') || [];
return Array.isArray(moreLinks) && moreLinks.length > 0 ? (
<Dropdown menu={{ items: getMoreLinksGroup(moreLinks) }} placement="bottomRight">
<Button size="small">
<FormattedMessage id="app.header.menu.more" />
Expand Down

0 comments on commit 3a7b215

Please sign in to comment.