React Native 和 require('http') [英] React Native and require('http')

查看:36
本文介绍了React Native 和 require('http')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

React Native 附带的节点核心似乎不包含节点核心 http.是否可以在 React Native 中添加和使用它?

非常感谢.

解决方案

我想你现在被困住了.我的理解是,虽然 React Native 使用 nodejs 来启动和运行,但运行时不是实际上 nodejs,这就是为什么你不能只是 require http.

这个已关闭的问题几乎说明了来自 nodejs 的 utilrequest:

https://github.com/facebook/react-native/issues/375>

The node core shipped with React Native does not seem to include node core http. Is it possible to add it and use at all within React Native?

Many Thanks in Advance.

解决方案

I think you're stuck at the moment. My understanding is that while React Native uses nodejs to get up and running, the runtime isn't actually nodejs, which is why you can't just require http.

This closed issue says pretty much that, with regards to util and request from nodejs:

https://github.com/facebook/react-native/issues/375

这篇关于React Native 和 require('http')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆