disable-react-devtools
disable-react-devtools copied to clipboard
NextJS upgrade
Thanks for adding NextJS support, but I haven't been able to get it working yet, just putting the disableReactDevTools() function in _app.js. The entire component tree is still visible with dev tools. Everything works great in React, but I haven't found a working solution yet for NextJS. Please advise on how you made it work. Thanks!
Update: I solved it by importing the code and making it into a hook that I call in _app.js
@bybruno, any idea ?
try this npm i disable-devtool see the npm link
if (
typeof window !== "undefined" &&
typeof window.navigator !== "undefined" &&
typeof navigator !== "undefined" &&
navigator.userAgent
) {
const disableDevtool = require("disable-devtool");
disableDevtool();
}