Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created June 29, 2019 19:25
Show Gist options
  • Save jsmanifest/2ab412d869d5b50f3fa71ff4824af7a2 to your computer and use it in GitHub Desktop.
Save jsmanifest/2ab412d869d5b50f3fa71ff4824af7a2 to your computer and use it in GitHub Desktop.
import { generateRandomUniqueKey } from 'utils/generating'
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={`items1_${to}`}>
<Link to={to}>{label}</Link>
</li>
))}
</ul>
<ul>
{items2.map(({ to, label }) => (
<li key={`items2_${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