score:1

Accepted answer
const DynamicTabPanes = (staticPanes, data) => {
  return staticPanes.concat(
    data.map((tab, index) => (
      <TabPane tab={tab.label} key={index}>
        {tab.content}
      </TabPane>
    ))
  );
};

function App() {
  const someApiData = [
    { label: "First", content: "First Content" },
    { label: "Second", content: "Second Content" },
  ];

  const staticPanes = [
    <TabPane key="static-1" tab="Static Tab">
      Some static content
    </TabPane>,
  ];

  return (
    <div className="App">
      <Tabs children={DynamicTabPanes(staticPanes, someApiData)} />
    </div>
  );
}

export default App;

Related Query

More Query from same tag