I try to use the package with babel and es6
import fetch from 'whatwg-fetch';
Unfortunately I get the following error:
Uncaught TypeError: (0 , _whatwgFetch2.default) is not a function
@abimelex
Description
A window.fetch JavaScript polyfill.
fetch do not export modules.
You can do
import 'whatwg-fetch';
// And then just use global variable.
fetch(...);
Ah thank you, thats perfect.
Don't forget to close issue if you found answers.
I solved it with import 'isomorphic-fetch'; in my jest-setup.js.
Most helpful comment
@abimelex
Description
fetch do not export modules.
You can do