import { FC, useEffect } from 'react'; interface WithoutSelectedServerProps { resetSelectedServer: Function; } export function withoutSelectedServer(WrappedComponent: FC) { return (props: WithoutSelectedServerProps & T) => { useEffect(() => { props.resetSelectedServer(); }, []); return ; }; }