react-tabs icon indicating copy to clipboard operation
react-tabs copied to clipboard

Generate new tab after click on the table row

Open hollabigj opened this issue 5 years ago • 1 comments

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.

hollabigj avatar Jul 17 '20 19:07 hollabigj

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?

hollabigj avatar Jul 17 '20 19:07 hollabigj