question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Workaround for React Native

See original GitHub issue

Hi, 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:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
thessemcommented, Jun 26, 2016

@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.

2reactions
thessemcommented, Jul 28, 2016

@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 then npm 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found