mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 01:20:24 +03:00
Enable react-hooks/exhaustive-deps linting rule
This commit is contained in:
parent
973f3e3c8b
commit
a23d441dd3
3 changed files with 3 additions and 4 deletions
|
@ -8,7 +8,6 @@
|
||||||
},
|
},
|
||||||
"ignorePatterns": ["src/service*.ts"],
|
"ignorePatterns": ["src/service*.ts"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"react-hooks/rules-of-hooks": "off",
|
"react-hooks/rules-of-hooks": "off"
|
||||||
"react-hooks/exhaustive-deps": "off"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ export function withSelectedServer<T = {}>(WrappedComponent: FC<WithSelectedServ
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
params.serverId && selectServer(params.serverId);
|
params.serverId && selectServer(params.serverId);
|
||||||
}, [params.serverId]);
|
}, [params.serverId, selectServer]);
|
||||||
|
|
||||||
if (!selectedServer) {
|
if (!selectedServer) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -10,7 +10,7 @@ export function withoutSelectedServer<T = {}>(WrappedComponent: FC<WithoutSelect
|
||||||
const { resetSelectedServer } = props;
|
const { resetSelectedServer } = props;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
resetSelectedServer();
|
resetSelectedServer();
|
||||||
}, []);
|
}, [resetSelectedServer]);
|
||||||
|
|
||||||
return <WrappedComponent {...props} />;
|
return <WrappedComponent {...props} />;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue