react/packages/react-devtools-core
Brian Vaughn 4b34a77d29
Improve Bridge Flow types (#352)
* Updated local fork of react-window
* Updated Fow 97 -> 103
* Lint ignore NPM dist
* Improved Bridge Flow types
2019-07-20 14:08:23 -07:00
..
src Improve Bridge Flow types (#352) 2019-07-20 14:08:23 -07:00
backend.js Standalone NPM packages and React Native support (#335) 2019-07-13 10:05:04 -07:00
package.json Updating NPM packages as 4.0.0-alpha.0 2019-07-19 10:09:49 -07:00
README.md Updating NPM packages as 4.0.0-alpha.0 2019-07-19 10:09:49 -07:00
standalone.js Standalone NPM packages and React Native support (#335) 2019-07-13 10:05:04 -07:00
webpack.backend.js Standalone NPM packages and React Native support (#335) 2019-07-13 10:05:04 -07:00
webpack.standalone.js Standalone NPM packages and React Native support (#335) 2019-07-13 10:05:04 -07:00

react-devtools-core

A standalone React DevTools implementation.

This is a low-level package. If you're looking for the Electron app you can run, use react-devtools package instead.

API

react-devtools-core

This is similar requiring the react-devtools package, but provides several configurable options. Unlike react-devtools, requiring react-devtools-core doesn't connect immediately but instead exports a function:

const { connectToDevTools } = require("react-devtools-core");
connectToDevTools({
  // Config options
});

Run connectToDevTools() in the same context as React to set up a connection to DevTools.
Be sure to run this function before importing e.g. react, react-dom, react-native.

The options object may contain:

  • host: string (defaults to "localhost") - Websocket will connect to this host.
  • port: number (defaults to 8097) - Websocket will connect to this port.
  • websocket: Websocket - Custom websocked to use. Overrides host and port settings if provided.
  • resolveNativeStyle: (style: number) => ?Object - Used by the React Native style plug-in.
  • isAppActive: () => boolean - If provided, DevTools will poll this method and wait until it returns true before connecting to React.

react-devtools-core/standalone

Renders the DevTools interface into a DOM node.

require("react-devtools-core/standalone")
  .setContentDOMNode(document.getElementById("container"))
  .setStatusListener(status => {
    // This callback is optional...
  })
  .startServer(port);

Reference the react-devtools package for a complete integration example.