mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-22 22:46:19 +00:00
18 lines
458 B
TypeScript
18 lines
458 B
TypeScript
import type { FC } from 'react';
|
|
import { useEffect } from 'react';
|
|
|
|
interface WithoutSelectedServerProps {
|
|
resetSelectedServer: Function;
|
|
}
|
|
|
|
export function withoutSelectedServer<T = {}>(WrappedComponent: FC<WithoutSelectedServerProps & T>) {
|
|
return (props: WithoutSelectedServerProps & T) => {
|
|
const { resetSelectedServer } = props;
|
|
useEffect(() => {
|
|
resetSelectedServer();
|
|
}, []);
|
|
|
|
return <WrappedComponent {...props} />;
|
|
};
|
|
}
|