static collectExtraData(): DebugData {
    const extraData: ExtraData = {};
    for (const [key, callback] of BugReporting._extraSources) {
      extraData[key] = callback();
    }
    const fileData: ExtraData = {};
    for (const [key, callback] of BugReporting._fileSources) {
      fileData[key] = callback();
    }
    infoLog('BugReporting extraData:', extraData);
    const BugReportingNativeModule = require('NativeModules').BugReporting;
    BugReportingNativeModule &&
      BugReportingNativeModule.setExtraData &&
      BugReportingNativeModule.setExtraData(extraData, fileData);

    const RedBoxNativeModule = require('NativeModules').RedBox;
    RedBoxNativeModule &&
      RedBoxNativeModule.setExtraData &&
      RedBoxNativeModule.setExtraData(extraData, 'From BugReporting.js');

    return { extras: extraData, files: fileData };
  }
This can be called from a native bug reporting flow, or from JS code.

If available, this will call `NativeModules.BugReporting.setExtraData(extraData)`
after collecting `extraData`.