import * as React from 'react'; import NavRouter from './NavRouter'; import { WithNavRouterProps } from './types'; import { isFeatureEnabled } from '../feature-checking'; const withNavRouter =

(Component: React.ComponentType

): React.FC

=> { function WithNavRouter({ history, initialEntries, ...rest }: P & WithNavRouterProps) { const { features } = rest; const isRouterDisabled = isFeatureEnabled(features, 'routerDisabled.value'); if (isRouterDisabled) { return ; } return ( ); } WithNavRouter.displayName = `withNavRouter(${Component.displayName || Component.name || 'Component'}`; return WithNavRouter; }; export default withNavRouter;