@react-pakistan/util-functions 1.25.6 → 1.25.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,6 +84,7 @@ var useFetch = function (url, config, deps) {
84
84
  var _e = (0, react_1.useState)(undefined), apiResult = _e[0], setApiResult = _e[1];
85
85
  var abortControllerRef = (0, react_1.useRef)(null);
86
86
  var isMounted = (0, react_1.useRef)(true);
87
+ var autoFetchedRef = (0, react_1.useRef)(false);
87
88
  (0, react_1.useEffect)(function () {
88
89
  isMounted.current = true;
89
90
  return function () {
@@ -222,7 +223,8 @@ var useFetch = function (url, config, deps) {
222
223
  });
223
224
  }); }, __spreadArray([url, defaultOptions, callback], deps, true));
224
225
  (0, react_1.useEffect)(function () {
225
- if (autoFetch) {
226
+ if (autoFetch && !autoFetchedRef.current) {
227
+ autoFetchedRef.current = true;
226
228
  fetchNow();
227
229
  }
228
230
  }, [fetchNow, autoFetch]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.25.6",
3
+ "version": "1.25.7",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {