This commit is contained in:
Jan Prochazka
2020-01-25 21:13:53 +01:00
parent 73bcfaeb36
commit 564875c32e
3 changed files with 93 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react';
import axios from './axios';
import useSocket from './SocketProvider';
import stableStringify from 'json-stable-stringify';
export default function useFetch({
url,
@@ -34,7 +35,7 @@ export default function useFetch({
socket.off(reloadTrigger, handleReload);
};
}
}, [url, params, socket, loadCounter]);
}, [url, stableStringify(params), socket, loadCounter]);
return value;
}