window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function () {}
import {
disableReactDevTools
} from '@utils/js/other';
if(process.env.NODE_ENV == 'production'){
disableReactDevTools();
}
// @utils/js/other.ts
export const disableReactDevTools = (): void => {
const noop = (): void => undefined;
const DEV_TOOLS = (window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
if (typeof DEV_TOOLS === 'object') {
for (const [key, value] of (<any>Object).entries(DEV_TOOLS)) {
DEV_TOOLS[key] = typeof value === 'function' ? noop : null;
}
}
};
import {
composeWithDevTools
} from 'redux-devtools-extension/developmentOnly';
// other code...
const store = createStore(
rootReducer,
composeWithDevTools(middlewareEnhancer)
);