React Native 和 require('http') [英] React Native and require('http')
问题描述
React Native 附带的节点核心似乎不包含节点核心 http.是否可以在 React Native 中添加和使用它?
非常感谢.
我想你现在被困住了.我的理解是,虽然 React Native 使用 nodejs 来启动和运行,但运行时不是实际上 nodejs,这就是为什么你不能只是 require
http.
这个已关闭的问题几乎说明了来自 nodejs 的 util
和 request
:
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屋!