Created
May 26, 2017 22:36
-
-
Save xpollen8/cf031fabca5351e11fc4bfd5a00170fc to your computer and use it in GitHub Desktop.
nextjs/link - how to get 'item.id' to evaluate?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Link from 'next/link'; | |
export default () => ( | |
<div> | |
Items | |
<ul> | |
{ | |
[ | |
{ name: 'item one', id: 1 }, | |
{ name: 'item two', id: 2 }, | |
].map( item => | |
<li key={item.id}><Link href='/item?id={item.id}' as='/item/{item.id}'><a>{item.name}</a></Link></li> | |
) | |
} | |
</ul> | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.