package.cjs.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.
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = disableReactDevTools;
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var isObjectOrFunction = function isObjectOrFunction(object) {
var type = (0, _typeof2["default"])(object);
return type === "function" || type === "object" && !!object;
};
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