🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@fvilers/disable-react-devtools

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fvilers/disable-react-devtools

A simple method to disable the React Developer Tools addon to access your application

1.3.0
latest
Version published
Weekly downloads
8K
13.06%
Maintainers
1
Weekly downloads
 
Created

disable-react-devtools

A simple method to disable the React Developer Tools addon to access your application

Support

If you use and like this library, feel free to support my Open Source projects.

donate

How to install

npm i @fvilers/disable-react-devtools

or

yarn add @fvilers/disable-react-devtools

How to use

Call the disableReactDevTools() method before React is loaded, in your main file.

import React from 'react';
import ReactDOM from 'react-dom';
import { disableReactDevTools } from '@fvilers/disable-react-devtools';
import App from './App';

if (process.env.NODE_ENV === 'production') {
  disableReactDevTools();
}

ReactDOM.render(<App />, document.getElementById('root'));

How it works

The disableReactDevTools() method will look for the React Developer Tools global hook and replace its properties and methods to prevent the plugin registration process.

Keywords

FAQs

Package last updated on 21 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts