Skip to content

Commit

Permalink
fix: use fragment for children
Browse files Browse the repository at this point in the history
  • Loading branch information
vpicone committed May 21, 2019
1 parent b9af9ca commit 173288d
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions packages/gatsby-theme-carbon/src/components/Switcher/Switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,37 @@ export const SwitcherLink = ({ disabled, children, ...rest }) => (
</li>
);

Switcher.defaultProps = {
children: [
<SwitcherLink href="https://ibm.com/design">IBM Design</SwitcherLink>,
const DefaultChildren = () => (
<>
<SwitcherLink href="https://ibm.com/design">IBM Design</SwitcherLink>
<SwitcherLink href="https://ibm.com/design/language">
IBM Design Language
</SwitcherLink>,
<SwitcherLink disabled>IBM Brand Center</SwitcherLink>,
<SwitcherDivider>Design disciplines</SwitcherDivider>,
</SwitcherLink>
<SwitcherLink disabled>IBM Brand Center</SwitcherLink>
<SwitcherDivider>Design disciplines</SwitcherDivider>
<SwitcherLink href="https://www.carbondesignsystem.com/">
Product
</SwitcherLink>,
</SwitcherLink>
<SwitcherLink href="https://www.ibm.com/standards/web/">
Digital
</SwitcherLink>,
<SwitcherLink disabled>Events</SwitcherLink>,
<SwitcherDivider>Design practices</SwitcherDivider>,
</SwitcherLink>
<SwitcherLink disabled>Events</SwitcherLink>
<SwitcherDivider>Design practices</SwitcherDivider>
<SwitcherLink href="https://www.ibm.com/design/thinking/">
IBM Enterprise Design Thinking
</SwitcherLink>,
</SwitcherLink>
<SwitcherLink href="https://www.ibm.com/design/language/disciplines/digital/">
IBM Design Research
</SwitcherLink>,
</SwitcherLink>
<SwitcherLink href="https://www.ibm.com/services/ibmix/">
IBM iX
</SwitcherLink>,
<SwitcherLink disabled>IBM AI</SwitcherLink>,
],
</SwitcherLink>
<SwitcherLink disabled>IBM AI</SwitcherLink>
</>
);

Switcher.defaultProps = {
children: <DefaultChildren />,
};

export default Switcher;

0 comments on commit 173288d

Please sign in to comment.