mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-09 01:37:24 +03:00
15 lines
392 B
TypeScript
15 lines
392 B
TypeScript
import { FC, useEffect } from 'react';
|
|
|
|
interface WithoutSelectedServerProps {
|
|
resetSelectedServer: Function;
|
|
}
|
|
|
|
export function withoutSelectedServer<T = {}>(WrappedComponent: FC<WithoutSelectedServerProps & T>) {
|
|
return (props: WithoutSelectedServerProps & T) => {
|
|
useEffect(() => {
|
|
props.resetSelectedServer();
|
|
}, []);
|
|
|
|
return <WrappedComponent {...props} />;
|
|
};
|
|
}
|