https://github.com/mikroskeem/react-devtools-disable
This module provides an easy way to disable React Devtools browser extension in the production environment
https://github.com/mikroskeem/react-devtools-disable
devtools disable react react-devtools-disable
Last synced: about 2 months ago
JSON representation
This module provides an easy way to disable React Devtools browser extension in the production environment
- Host: GitHub
- URL: https://github.com/mikroskeem/react-devtools-disable
- Owner: mikroskeem
- Created: 2019-09-11T05:55:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-11T06:16:56.000Z (almost 7 years ago)
- Last Synced: 2025-03-28T21:43:49.073Z (about 1 year ago)
- Topics: devtools, disable, react, react-devtools-disable
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Devtools disable(r)
This module provides an easy way to disable React Devtools browser extension in the production environment
## Usage
```javascript
import { disableDevToolsWhen } from 'react-devtools-disable';
import { isProdMode } from 'whatever'; // function
disableDevToolsWhen(isProdMode);
ReactDOM.render(..., ...);
```
or
```javascript
import { disableDevTools } from 'react-devtools-disable';
if (window.location.port !== 443) {
disableDevTools();
}
ReactDOM.render(..., ...);
```
## License
MIT