Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isomorphic-fetch読み込み時にselfが名前解決できない #44

Open
nukosuke opened this issue Jun 28, 2016 · 0 comments
Open

isomorphic-fetch読み込み時にselfが名前解決できない #44

nukosuke opened this issue Jun 28, 2016 · 0 comments
Assignees
Labels

Comments

@nukosuke
Copy link
Owner

nukosuke commented Jun 28, 2016

実際の読み込み箇所。

require('whatwg-fetch');
module.exports = self.fetch.bind(self);

selfやらthisは実装によって違う。
React Nativeが採用しているJavaScriptCoreはthis
よってselfundefinedになる。

isomorphic-fetchのfetch-npm-browserify.jsを以下のようにすることで一応解決する。

require('whatwg-fetch');
module.exports = this.fetch.bind(this);

isomorphic-fetchからfetch-everywhereに変更すると解決しそう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant