Skip to content

Can't get this working #1

Closed
Closed

Description

@davej

It seems to install ok from the console but the React tab does not appear in my devtools

screen shot 2016-05-25 at 18 51 12

Using Electron 1.0.2 and React 15.0.1. Also using Webpack and Babel in my build if that makes a difference.

Activity

  1. philostler commented on May 25, 2016

    @philostler

    Same experience as @davej using Electron 1.1.1 and React 15.1.0

  2. firejune commented on May 26, 2016

    @firejune
    Owner

    It's not working content_scripts in manifest.json on Electron. So React's inject script loading menualy. and I add a API for script injecting new version 0.2.0. please update this module.

    Then add the React's inject script in to main.html(or entry root js) before loading your app
    source running on renderer process:

    ...
    <script>
      // in development.
      require('electron-react-devtools').inject()
      // your app root running on renderer process.
      require('./src')
    </script>
    ...

    Thanks for your feedback.

  3. davej commented on May 26, 2016

    @davej
    Author

    Thanks, was able to get it working in one step using:

    <script>
      if (process.env.NODE_ENV !== 'production') {
        const electronReactDevTools = require('electron-react-devtools');
        electronReactDevTools.inject();
        electronReactDevTools.install();
      }
      …
    </script>

    Might be a bit easier to present the install instructions in one step like this rather than asking the user to write require('electron-react-devtools').install() in their console.

    Thanks for all your great work :-)

  4. enlight commented on May 26, 2016

    @enlight

    Might be a bit easier to present the install instructions in one step like this rather than asking the user to write require('electron-react-devtools').install() in their console.

    require('electron-react-devtools').install() only needs to be executed once, after that the DevTools extension will be loaded automatically every time you run your Electron app.

  5. davej commented on May 26, 2016

    @davej
    Author

    require('electron-react-devtools').install() only needs to be executed once

    That doesn't seem to be the case for me. Other devtools plugins like spectron work like this but electron-react-devtools seems to require to be installed on every run for every window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions