meteor - process.nextTick 不是一个函数(React native、ddp、meteor)

标签 meteor react-native ddp

在 native react 中,我尝试使用“ddp-client”节点库连接到 meteor 服务器。连接成功后,我在客户端收到以下错误:

2016-01-17 16:14:15.992 [trace][tid:com.facebook.React.JavaScript] ddp message: {"msg":"connected","session":"PGLBqgvoeuXgBtke2"}
2016-01-17 16:14:16.007 [warn][tid:com.facebook.React.JavaScript] process.nextTick is not a function. (In 'process.nextTick(function(_this){
return function(){
return _this._flush();};}(

this))', 'process.nextTick' is undefined)
2016-01-17 16:14:16.008 [error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: process.nextTick is not a function. (In 'process.nextTick(function(_this){
return function(){
return _this._flush();};}(

this))', 'process.nextTick' is undefined)

最佳答案

process.nextTick React Native 上不存在,所以我们必须对它进行 polyfill。就像 process.nextTick = setImmediate 一样简单.

示例:https://github.com/spencercarli/meteor-todos-react-native/blob/master/ReactNativeTodos/app/config/db/lib/process.polyfill.js

您需要确保在根组件文件(例如 index.ios.js)中执行此操作

希望这对你有帮助!

关于meteor - process.nextTick 不是一个函数(React native、ddp、meteor),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34845760/

相关文章:

Meteor 和 C nopoll 应用程序之间的连接丢失

django - 如何使用 django-ddp

android - 在 meteor 的 Android 模拟器上启动应用程序永远不会完成

node.js - mup 部署时 buffer.js Node 错误 - 我如何撤消 ` sudo ln -sf/usr/local/n/versions/node/<VERSION>/bin/node/usr/bin/node `

javascript - 以编程方式单击 react native 中的按钮

javascript - SetState 回调不等待状态更新

javascript - AsyncStorage 获取项目

javascript - 使用 Meteor 防止表单提交

javascript - 如何避免同一事件的重复执行?

security - meteor ddp 连接安全和 https