L
L
lexstile2020-04-28 17:48:26
React
lexstile, 2020-04-28 17:48:26

How to properly organize the structure of tabs?

What is the best way to create a tab structure from scratch?
For example:

// Example 1
  <Tabs>
    <Tab
      label="Таб 1"
      content={component1}
      active
    />
    <Tab
      label="Таб 2"
      content={component2}
    />
  </Tabs>

// Example 2
  <Tabs
    data={[
      {
        label: 'Таб 1',
        content: component1,
      },
      {
        label: 'Таб 2',
        content: component2,
      },
    ]}
    activeTabIndex={1}
  />

Which option is better to use or can be completely different?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question