Use fetch as a polyfill
Use fetch as a polyfill

Summary:
The old whatwg-fetch module doesn't actually export anything, so we would always hit the `else` condition.

The new whatwg-fetch (3.0.0, introduced in #24418) now exports an ES module. As a result, `whatwg` and `whatwg.fetch` are both truthy but the `module.exports` will end up empty. This breaks the RN fetch module.

This will switch the behavior back to the expected polyfill behavior (calling `require('whatwg-fetch')` and allowing it to polyfill fetch in global scope). The RN fetch module will re-export these globals.

Reviewed By: cpojer

Differential Revision: D15639851

fbshipit-source-id: ebd8bce85f7797d8539f53982e515ac47f6425e7

pandiaraj44/react-native,hoangpham95/react-native,javache/react-native,exponentjs/react-native,myntra/react-native,pandiaraj44/react-native,exponent/react-native,janicduplessis/react-native,exponentjs/react-native,exponentjs/react-native,javache/react-native,hammerandchisel/react-native,myntra/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,hammerandchisel/react-native,myntra/react-native,janicduplessis/react-native,exponent/react-native,facebook/react-native,facebook/react-native,hammerandchisel/react-native,javache/react-native,hoangpham95/react-native,facebook/react-native,arthuralee/react-native,facebook/react-native,exponent/react-native,exponent/react-native,pandiaraj44/react-native,hammerandchisel/react-native,pandiaraj44/react-native,javache/react-native,janicduplessis/react-native,myntra/react-native,hammerandchisel/react-native,arthuralee/react-native,pandiaraj44/react-native,exponentjs/react-native,exponent/react-native,hammerandchisel/react-native,hoangpham95/react-native,facebook/react-native,myntra/react-native,exponent/react-native,facebook/react-native,myntra/react-native,javache/react-native,exponentjs/react-native,javache/react-native,hoangpham95/react-native,javache/react-native,myntra/react-native,janicduplessis/react-native,janicduplessis/react-native,hoangpham95/react-native,exponentjs/react-native,javache/react-native,hoangpham95/react-native,arthuralee/react-native,janicduplessis/react-native,hoangpham95/react-native,arthuralee/react-native,myntra/react-native,arthuralee/react-native,exponent/react-native,pandiaraj44/react-native,hoangpham95/react-native,hammerandchisel/react-native,exponentjs/react-native,myntra/react-native,javache/react-native,facebook/react-native,exponentjs/react-native,exponent/react-native,pandiaraj44/react-native,pandiaraj44/react-native,hammerandchisel/react-native,janicduplessis/react-native