react-tabs
react-tabs copied to clipboard
Generate new tab after click on the table row
Not a bug.
I can't find example on generate new tab on your page.
Mine is working but it doesn't generate new tab after you click on the row.
Example:
first component:
<tr {...row.getRowProps()} onClick={ (e) => Test(row.values)} />
second component:
function Test(data) {
return (
<>
{Object.keys(data).map(key =>
<Tab key={key}>{key}</Tab>
)}
</>
)
}
Third component:
const TabTable = () => {
return (
<div>
<Tabs>
<TabList>
<Tab key="Main">Main</Tab>
<Test />
</TabList>
<TabPanel>
<LoadData />
</TabPanel>
</Tabs>
</div>
);
}
LoadData is a table.
Yes, I use import Test in TabTable, it's just snippets.
That would be great for people who are new at generating tabs.
On side note:
I did not use Props or State. Using export.
Is that probably why it's not being dynamically without Props or State?