react-native-network-logger
Version:
An HTTP traffic monitor for React Native with zero dependencies
23 lines (22 loc) • 749 B
JavaScript
;
let XHRInterceptor;
try {
// new location for React Native 0.80+
const module = require('react-native/src/private/devsupport/devmenu/elementinspector/XHRInterceptor');
XHRInterceptor = module.default ?? module;
} catch {
try {
// new location for React Native 0.79+
const module = require('react-native/src/private/inspector/XHRInterceptor');
XHRInterceptor = module.default ?? module;
} catch {
try {
const module = require('react-native/Libraries/Network/XHRInterceptor');
XHRInterceptor = module.default ?? module;
} catch {
throw new Error('XHRInterceptor could not be found in either location');
}
}
}
export default XHRInterceptor;
//# sourceMappingURL=XHRInterceptor.js.map