Adel Benyahia
Nov 2, 2022

--

I will share with you my approach:
1. Install npm disable-react-devtools package

npm i @fvilers/disable-react-devtools

2. Add this code to index.js

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'));

--

--

Adel Benyahia

Web application developer (HTML │ CSS │ JS | ReactJS | NextJS | NestJS | MERN)