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

Use Fetch API instead of node.js http #40

Open
incorvia opened this issue Nov 17, 2017 · 1 comment
Open

Use Fetch API instead of node.js http #40

incorvia opened this issue Nov 17, 2017 · 1 comment

Comments

@incorvia
Copy link

It appears that the HttpSoftAP.js uses the node.js "http" module. However, this http module is not supported by React Native, leading to the popular tool rn-nodeify. Among other things, in a react-native project, rn-nodeify will install react-native-http, a react-native compatible library that attempts to provide the same http API but in a module that is compatible with react-native. React-Native-HTTP is poorly maintained, so it does not include methods like req.setTimeout which is used in this particularly library making it incompatible.

Facebook uses the Fetch API for maximum compatibility. You can read more about it here. Browsers now also implement this API with only older browsers not supporting it.

The world is converging on fetch..

Cross-Fetch is a library that makes using fetch across all 3 simple. It is certainly nice that softap-setup-js does not have any real dependencies, however, using cross-fetch would make it a lot easier to incorporate this library into react-native. Can we please consider using cross-fetch instead of HTTP so we can have the cross compatibility this library deserves?

@rafkhan
Copy link

rafkhan commented May 11, 2018

Is anyone following up on this? I'm working on a react-native application that needs this, and would be able to contribute.

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

No branches or pull requests

2 participants