I'm looking to handle external links in menu component (like my github/twitter for personal site). Would you accept a PR like the following or prefer a different approach?
<ul>
{items.map(item => {
const { label, to, icon: Icon, external, linkProps } = item;
return (
<li key={label}>
{external ?
<a href={to} target="_blank">
{Icon && <Icon />}
<span>{label}</span>
</a>
:
<Link to={to} activeClassName="active" {...linkProps}>
{Icon && <Icon />}
<span>{label}</span>
</Link>
}
</li>
);
})}
</ul>
const menu = [
{ label: 'Home', to: '/', icon: HomeIcon },
{ label: 'Blog', to: '/blog', icon: BlogIcon },
{ label: 'GitHub', to: 'http://github.com/jkornblum', icon: GitHubIcon, external: true },
];