Workaround for React Native
See original GitHub issueHi, I’m using isomorphic-fetch
in a shared library used by React and React Native. React Native provides its own fetch, so I’m currently using a workaround adapted from github/fetch#125.
if (typeof process !== 'undefined') {
require('isomorphic-fetch');
}
Just wondering if something like this should be integrated into the isomorphic-fetch
library. Thanks.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
react-native-admob-workaround - npm
A react-native module for Google AdMob Banners, Interstitials, Rewarded Videos and also DFP Banners. The banner types are implemented as ...
Read more >[HAS WORKAROUND] Android build fails since 0.71.0-rc.0 tag ...
You can resolve this problem by forcing the React Native dependency to the version you expect with something like this implementation 'com.
Read more >Improving User Experience - React Native
Improving User Experience. Configure text inputs. Entering text on touch phone is a challenge - small screen, software keyboard.
Read more >React Native Problems And Ways To Solve Them - Purrweb
The only solution to this React Native problem is patience, meticulousness, and experience. Research the modules you like, try to find ...
Read more >Our Solution for Measuring React Native Rendering Times
After Shopify went all-in on React Native, we had to find a way to confirm our mobile apps are fast. The solution is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@matthew-andrews would it be possible to take another look at this? I’m on react native and I’m using some libraries that pull in this one as a dependancy, I’ve had to shrinkwrap them so that they use https://github.com/matthew-andrews/isomorphic-fetch/pull/80 instead.
I understand it’s unfair to expect you to support other people using your library badly, so I have no real expectations here, I just wanted to point out that perhaps the use case is slightly less obscure than you thought.
@sosaucily Shrinkwrap the dependancy… read up on shrinkwrapping in npm, but the short version is you change the dependancy of redux-api-middleware in its package.json to point to https://github.com/matthew-andrews/isomorphic-fetch/pull/80 instead of this npm package (read up on using github branches as dependancies if you’re not sure of the syntax), run
npm install
thennpm shrinkwrap
to make sure it sticks.Caveat of my advice is I can’t remember if this is exactly what I did, and my knowledge of npm is pretty rough