mobx-devtools
mobx-devtools copied to clipboard
How to disable ability to use devtools?
I can disable react-devtools with code like this:
for (const prop in window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__[prop] = isFunction(
window.__REACT_DEVTOOLS_GLOBAL_HOOK__[prop]
)
? () => ()
: null;
}
Do you know the ability to disable mobx-devtools extension for production? I do not want to give the ability for clients to see my data.
Well. you can try the same with __MOBX_DEVTOOLS_GLOBAL_HOOK__.
If it's possible to run some code before loading mobx, then delete window.__MOBX_DEVTOOLS_GLOBAL_HOOK__ should be enough.