【问题标题】:How to trace error in react native in reflux?如何在回流反应中追踪错误?
【发布时间】:2016-11-05 19:27:29
【问题描述】:

我如何追踪这个错误? screen here 我可以在我的代码中找到“应用”属性。 感谢您的帮助!

我通过注释每个函数发现了错误

  onLoadUser: function (user) {
    Actions.loadUser.completed(user); // at this place catch error
  },
  onLoadUserCompleted: function (user) {
    this.setCurrentUser(user);
  },

  setCurrentUser(user) {
    currentUser = {
      user_id: user.user_id,
      token: user.access_token,
      username: user.username,
      email: user.email
    }
  },

  getCurrentUser() {
    return currentUser;
  },

为什么会这样?(

【问题讨论】:

    标签: reactjs react-native refluxjs


    【解决方案1】:

    如果您连接到调试服务器,通常在一两秒后,捆绑的行将替换为源代码文件和行。 如果没有,您可以在开发菜单中启用远程调试,并使用 chrome 调试流程。

    您可以在 Facebook 文档中阅读有关调试 react-native 应用程序的更多信息:
    https://facebook.github.io/react-native/docs/debugging.html

    【讨论】:

    • 它不会在我的源代码文件中显示错误,只是在 react native 的文件中
    • 你能显示为一些代码吗?试图了解你做错了什么?
    • 这很难说。我会说你的代码有一些未定义的函数,它在某处被调用,可能是通过本机反应。就像我在回答中所说的那样。尝试在 chrome 中进行远程调试,并查看代码中此错误的确切位置。
    • 这很奇怪。你确定这个函数存在吗?尝试调用 alert(Actions.loadUser.completed) 看看弹窗是否显示 undefined 或 function
    猜你喜欢
    • 2011-01-09
    • 2018-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-05
    • 2011-05-10
    • 1970-01-01
    相关资源
    最近更新 更多