Skip to content

Commit

Permalink
put Tab content under route to avoid multiple render
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMarcMilletScality committed Jun 25, 2024
1 parent bf0df90 commit a84e293
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/lib/components/tabsv2/Tabsv2.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,30 +219,30 @@ function Tabs({
)}
</ScrollableContainer>
{filteredTabsChildren.map((tab, index) => (
<TabContent
className="sc-tabs-item-content"
tabContentColor={tabContentColor}
withoutPadding={tab.props.withoutPadding}
<Route
exact={tab.props.exact}
sensitive={tab.props.sensitive}
strict={tab.props.strict}
path={
tab.props.path.startsWith('/')
? tab.props.path
: url + '/' + tab.props.path
}
key={index}
>
<Route
exact={tab.props.exact}
sensitive={tab.props.sensitive}
strict={tab.props.strict}
path={
tab.props.path.startsWith('/')
? tab.props.path
: url + '/' + tab.props.path
}
<TabContent
className="sc-tabs-item-content"
tabContentColor={tabContentColor}
withoutPadding={tab.props.withoutPadding}
>
{!tab.props.query ||
(tab.props.query && matchQuery(tab.props.query)) ? (
tab.props.children
) : (
<></>
)}
</Route>
</TabContent>
</TabContent>
</Route>
))}
</TabsContainer>
</TabsContext.Provider>
Expand Down

0 comments on commit a84e293

Please sign in to comment.