@trackunit/react-core-contexts-test 0.1.61 → 0.1.62
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.
- package/index2.cjs +3 -3
- package/index2.js +3 -3
- package/package.json +1 -1
package/index2.cjs
CHANGED
|
@@ -438,10 +438,10 @@ const useLogPropsChanged = (propsToWatch) => {
|
|
|
438
438
|
react$1.useEffect(() => {
|
|
439
439
|
const changedProps = Object.entries(propsToWatch !== null && propsToWatch !== void 0 ? propsToWatch : {}).reduce((result, [key, value]) => {
|
|
440
440
|
if (prevPropsRef.current && prevPropsRef.current[key] !== value) {
|
|
441
|
-
result[key] = [prevPropsRef.current[key], value];
|
|
441
|
+
result[key + ""] = [prevPropsRef.current[key], value];
|
|
442
442
|
}
|
|
443
443
|
return result;
|
|
444
|
-
},
|
|
444
|
+
}, {});
|
|
445
445
|
if (Object.keys(changedProps).length > 0) {
|
|
446
446
|
// eslint-disable-next-line no-console
|
|
447
447
|
Object.keys(changedProps).forEach(changedProp => {
|
|
@@ -466,7 +466,7 @@ const useLogPropsChanged = (propsToWatch) => {
|
|
|
466
466
|
console.dir(changedProps);
|
|
467
467
|
}
|
|
468
468
|
prevPropsRef.current = propsToWatch;
|
|
469
|
-
});
|
|
469
|
+
}, [propsToWatch]);
|
|
470
470
|
};
|
|
471
471
|
|
|
472
472
|
/**
|
package/index2.js
CHANGED
|
@@ -436,10 +436,10 @@ const useLogPropsChanged = (propsToWatch) => {
|
|
|
436
436
|
useEffect(() => {
|
|
437
437
|
const changedProps = Object.entries(propsToWatch !== null && propsToWatch !== void 0 ? propsToWatch : {}).reduce((result, [key, value]) => {
|
|
438
438
|
if (prevPropsRef.current && prevPropsRef.current[key] !== value) {
|
|
439
|
-
result[key] = [prevPropsRef.current[key], value];
|
|
439
|
+
result[key + ""] = [prevPropsRef.current[key], value];
|
|
440
440
|
}
|
|
441
441
|
return result;
|
|
442
|
-
},
|
|
442
|
+
}, {});
|
|
443
443
|
if (Object.keys(changedProps).length > 0) {
|
|
444
444
|
// eslint-disable-next-line no-console
|
|
445
445
|
Object.keys(changedProps).forEach(changedProp => {
|
|
@@ -464,7 +464,7 @@ const useLogPropsChanged = (propsToWatch) => {
|
|
|
464
464
|
console.dir(changedProps);
|
|
465
465
|
}
|
|
466
466
|
prevPropsRef.current = propsToWatch;
|
|
467
|
-
});
|
|
467
|
+
}, [propsToWatch]);
|
|
468
468
|
};
|
|
469
469
|
|
|
470
470
|
/**
|