I am trying to create some pills for a card display. I have an array of objects which I am mapping over to produce them on the page. Within the objects I have an array called tech which has something like tech: ['python', 'react.js'] etc.
something like this:
const data = [
{
imgUrl: "https://images.unsplash.com/photo-1551882547-ff40c63fe5fa?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80",
description: 'oifonefpempfewpvpewmpew',
title: "Some project name",
tech: ["python", "react.js"],
},
{
imgUrl: "https://images.unsplash.com/photo-1551882547-ff40c63fe5fa?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80",
description: 'oifonefpempfewpvpewmpew',
title: "Some project name",
tech: ["python", "react.js"],
},
]
I have mapped over that array like so.
<div className="">
{data.map(tech => (
<span className="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2">
{tech.tech}
</span>
))}
</div>
Which it prints out the items, but it doesnt split them up into seperate pills just prints the array in one pill.
I am using Gatsby for my project
How can i split them up?
data.techis the array you want to map over, but it doesn't seem to be an array of objectsratingfield at any level