Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron - How to add react dev tool

Tags:

electron

What is the easy way to add react dev tool to electron window? I try add the extension hash

BrowserWindow.addDevToolsExtension('path/to/extension/ade2343nd23k234bdb').15.01

But when the extension update, I had to manually update the string in main.js. I'm looking for a better way.

like image 979
angry kiwi Avatar asked Jun 20 '16 16:06

angry kiwi


1 Answers

Here is a Solution for Electron <= 1.2.1 version

1- In your app folder

npm install --save-dev electron-react-devtools

2- Open your electron app, click on (view/toggle developer tools). In the console tab insert the following code and hit enter:

 require('electron-react-devtools').install()

3- Reload/refresh your electron app page and you'll see the react dev tools appear.

4- Done!


See screen shots bellow

Paste/type code on console tab

hit enter

react dev tools enabled

like image 179
Jonca33 Avatar answered Oct 02 '22 08:10

Jonca33