How to use the react-devtools-core/standalone.setContentDOMNode function in react-devtools-core

To help you get started, we’ve selected a few react-devtools-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebook / flipper / src / plugins / reactdevtools / index.tsx View on Github external
async initializeDevTools(devToolsNode: HTMLElement) {
    const port = await getPort({port: 8097}); // default port for dev tools
    ReactDevToolsStandalone.setContentDOMNode(devToolsNode).startServer(port);
    const device = await this.getDevice();
    if (device) {
      const host =
        device.deviceType === 'physical'
          ? address.ip()
          : device instanceof AndroidDevice
          ? '10.0.2.2' // Host IP for Android emulator host system
          : 'localhost';
      this.client.call('config', {port, host});

      if (['quest', 'go', 'pacific'].includes(device.title.toLowerCase())) {
        const device = await this.getDevice();
        (device as AndroidDevice).reverse([port, port]);
      }
    }
  }

react-devtools-core

Use react-devtools outside of the browser

MIT
Latest version published 1 month ago

Package Health Score

95 / 100
Full package analysis

Similar packages