Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate new tab after click on the table row #335

Open
hollabigj opened this issue Jul 17, 2020 · 1 comment
Open

Generate new tab after click on the table row #335

hollabigj opened this issue Jul 17, 2020 · 1 comment

Comments

@hollabigj
Copy link

hollabigj commented Jul 17, 2020

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant