use-prevent-dev-tools
v1.1.1
Published
A React hook to prevent the use of developer tools.
Downloads
36
Maintainers
Readme
use-prevent-dev-tools
A React hook that prevents opening the browser's developer tools in production mode.
Installation
npm install use-prevent-dev-tools
Usage
import React from "react";
import usePreventDevTools from "use-prevent-dev-tools";
const App = () => {
//To lock the developer tools, set lockDevTools to true.
const devtoolsOpen = usePreventDevTools({ lockDevTools: false });
return (
<div>
<h1>My React App</h1>
{devtoolsOpen && <p>Developer tools are open!</p>}
{!devtoolsOpen && <p>Developer tools are closed.</p>}
</div>
);
};
export default App;
Author
Yunus Emre Çıracı
LinkedIn