I want to render tabs that I stored in an array and set the first tab in the array as default.
Not using an array, it would look kind of like this:
<Tab
name={"first tab"}
default
/>
<Tab
name={"second tab"}
/>
But now since I'm using an array and mapping through it, I'm wondering how i can set the default attribute for the first tab.
This is how the array looks like:
const tabs = [
{
name: "first tab",
},
{
name: "second tab",
}]
This is my map function:
{tabs.map(tab => (
<Tab
name={tab.name} />
)}