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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

hi, how to generate multiple tab in tabview #1812

Open
qzw881130 opened this issue Apr 15, 2024 · 1 comment
Open

hi, how to generate multiple tab in tabview #1812

qzw881130 opened this issue Apr 15, 2024 · 1 comment

Comments

@qzw881130
Copy link

qzw881130 commented Apr 15, 2024

馃挰 hi, how to generate multiple tab in tabview

UI Kitten and Eva version

"@ui-kitten/components": "5.3.1",
"@ui-kitten/eva-icons": "5.3.1",
"@ui-kitten/metro-config": "5.3.1",
const Tabs = () => {
  return (
    <React.Fragment>
    {EshopsData.map((_, idx) =>(
        <Tab title={'aaa-'+idx}>
          <Layout style={styles.tabContainer}>
            <Text category='h5'>aaaa</Text>
          </Layout>
        </Tab>))}
    </React.Fragment>
  );
}

          <TabView
          selectedIndex={selectedIndex}
          shouldLoadComponent={shouldLoadComponent}
          onSelect={index => setSelectedIndex(index)}
          children={<Tabs />}
        >
          
        </TabView>

pls help me, tell me how to fix it?

@qzw881130
Copy link
Author

okay.
i solved it.
like this:

          <TabView
          selectedIndex={selectedIndex}
          shouldLoadComponent={shouldLoadComponent}
          onSelect={index => setSelectedIndex(index)}
          children={EshopsData.map(({category}, idx) =>(
            <Tab title={category} key={idx}>
              <Layout style={styles.tabContainer}>
                <Text category='h5'>aaaa</Text>
              </Layout>
            </Tab>))}
        >
        </TabView>

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