What is the best way to map over array inside an array when we are importing a local file. I get an error : "Cannot read property 'map' of undefined".
Shop.js
import Details from './details.json'
render(){
return (
<ul>
{Details.map(detail => (
detail.shops.map(shop=> (
<li>{shop}</li>
))
))}
</ul>
)}
Json is like this:
[
{
"id": 1,
"shops": ["one", "two"]
}
]