Is there a clean way to disable devtools in prod? #842
Replies: 5 comments 8 replies
-
It depends on your bundler, but something like this might work. const devtoolsInNonProd = process.env.NODE_ENV === 'production' ? (fn) => fn : devtools Typing can be tricky, though. |
Beta Was this translation helpful? Give feedback.
-
hi @mlazarenco and @dai-shi , myMiddlewares((set)=> myMiddlewares((set) => ({
})) but this doesn't seem to work .. i can see the instance in the Redux dev tool . i even tried setting enabled flag based on |
Beta Was this translation helpful? Give feedback.
-
After continuous attempts, this is the best use guide I think at the moment.
|
Beta Was this translation helpful? Give feedback.
-
There's actually a way - I found it poorly documented.
|
Beta Was this translation helpful? Give feedback.
-
This helps to block the output of the slice in redux devtools, but the assembly still gets a block of code that is superfluous for the visitor. I have not been able to find a way to ensure that the tool does not get into the assembly, but unsuccessfully, especially it is difficult to implement with TS by saving types and it is not clear what to do with signatures for set. It seems to be a problem. Found a solution that works for me:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions