Electron - How to add react dev tool

后端 未结 3 1806
眼角桃花
眼角桃花 2021-01-14 01:01

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

BrowserWindow.addDevToolsExtension(\'path/to/extension/ade2343nd23

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 01:21

    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

提交回复
热议问题