Add option for tabs to be returned without wrapping router

[MAILPOET-2775]
This commit is contained in:
Jan Jakeš
2020-06-15 13:08:39 +02:00
committed by Veljko V
parent 67212cd9c9
commit c6f55c2533

View File

@@ -39,7 +39,7 @@ const RouterAwareTabs = (props: TabProps & {
};
type Props = TabProps & {
routerType?: 'hash' | 'browser',
routerType?: 'hash' | 'browser' | 'switch-only',
routerPrefix?: string,
};
@@ -86,6 +86,10 @@ const RoutedTabs = ({
</>
);
if (routerType === 'switch-only') {
return routedTabs;
}
return routerType === 'browser'
? <BrowserRouter>{routedTabs}</BrowserRouter>
: <HashRouter>{routedTabs}</HashRouter>;