In the NextJS tutorial we are shown how to render a list of Batman show names from a map. Fetching Batman Shows
In that tutorial there is this fragment that gets the data from the map:
<ul>
{props.shows.map(({show}) => (
<li key={show.id}>
<Link as={`/p/${show.id}`} href={`/post?id=${show.id}`}>
<a>{show.name}</a>
</Link>
</li>
))}
</ul>
But what if the JSON document is much simpler e.g.
[
{
"id":1,
"text":"first doc",
},
{
"id":2,
"text":"second doc",
}
]
How do you prepare the data set (got via the getInitialProps call) and access from the props data?
With this example data the goal would be to build a HTML list of values of "text".