Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created June 29, 2019 19:24
Show Gist options
  • Save jsmanifest/65d784293ee4ea332776c112f41c0f3b to your computer and use it in GitHub Desktop.
Save jsmanifest/65d784293ee4ea332776c112f41c0f3b to your computer and use it in GitHub Desktop.
const Cereal = ({ items, ...otherProps }) => {
const indexHalf = Math.floor(items.length / 2)
const items1 = items.slice(0, indexHalf)
const items2 = items.slice(indexHalf)
return (
<>
<ul>
{items1.map(({ to, label }) => (
<li key={to}>
<Link to={to}>{label}</Link>
</li>
))}
</ul>
<ul>
{items2.map(({ to, label }) => (
<li key={to}>
<Link to={to}>{label}</Link>
</li>
))}
</ul>
</>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment