Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

Log React Native HTTP calls on Chrome dev tools

There is a workaround to log all React Native HTTP Api calls on the Chrome dev tools. Add the following code to the index files:

if (__DEV__) {
  GLOBAL.XMLHttpRequest = GLOBAL.originalXMLHttpRequest || GLOBAL.XMLHttpRequest;

Make sure it only works for the dev enviroment checking the __DEV__ variable.