mobx-devtools icon indicating copy to clipboard operation
mobx-devtools copied to clipboard

How to disable ability to use devtools?

Open fnpen opened this issue 6 years ago • 1 comments

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.

fnpen avatar Mar 07 '19 14:03 fnpen

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.

andykog avatar Mar 10 '19 17:03 andykog