import { ComponentType } from 'react'; import { UIRouterContextComponent } from '@uirouter/react-hybrid'; export function withUIRouter( WrappedComponent: ComponentType ): ComponentType { // Try to create a nice displayName for React Dev Tools. const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; function WrapperComponent(props: T & JSX.IntrinsicAttributes) { return ( ); } WrapperComponent.displayName = `withUIRouter(${displayName})`; return WrapperComponent; }