We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 740b46c + c9f8829 commit 1dfaf70Copy full SHA for 1dfaf70
1 file changed
packages/devtool-extenstion/extension/core/injectGlobalHook.js
@@ -55,6 +55,8 @@ function injectHelpers(target) {
55
};
56
57
const parseData = (data) => {
58
+ //For Detecting Circular Structures
59
+ const seen = new WeakSet();
60
const stringifyResolver = function (k, v) {
61
if (typeof v === "function") {
62
return "function () {}";
@@ -77,6 +79,13 @@ function injectHelpers(target) {
77
79
if (isReactNode(k, v)) {
78
80
return "<REACT NODE>";
81
}
82
+ //Detect Circular Structure
83
+ if (typeof v === "object" && v !== null) {
84
+ if (seen.has(v)) {
85
+ return "Circular Structure";
86
+ }
87
+ seen.add(v);
88
89
return v;
90
91
0 commit comments