-
Notifications
You must be signed in to change notification settings - Fork 6
Network requests in Chrome DevTools
Tam edited this page Jun 2, 2017
·
3 revisions
Add the following immediately after one of your primary React imports (i.e. in index.android.js
& index.ios.js
)
import React, { Component } from "react";
if (__DEV__) {
GLOBAL.XMLHttpRequest = GLOBAL.originalXMLHttpRequest || GLOBAL.XMLHttpRequest;
GLOBAL.FormData = GLOBAL.originalFormData || GLOBAL.FormData;
}
This will cause your app to use the original XMLHttpRequest
, instead of the native polyfill. This one line will also work for fetch
requests (the fetch
function appears to be polyfilled by XMLHttpRequest
).
You can exclude the FormData
line if you're not using FormData
anywhere.