package.initializers.reactDevTools.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
import _typeof from "@babel/runtime/helpers/typeof";
var isObjectOrFunction = function isObjectOrFunction(object) {
var type = _typeof(object);
return type === "function" || type === "object" && !!object;
};
export default function disableReactDevTools() {
if (window && window.document) {
var developerToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
if (!isObjectOrFunction(developerToolsHook)) return;
for (var prop in developerToolsHook) {
if (prop === "renderers") {
developerToolsHook[prop] = new Map();
} else {
developerToolsHook[prop] = typeof developerToolsHook[prop] === "function" ? Function.prototype : null;
}
}
}
}
//# sourceMappingURL=reactDevTools.js.map