RCTDevSettings.setIsDebuggingRemotely(true)错误输出" undefined不是对象"

时间:2017-04-28 21:06:22

标签: ios react-native

使用react native 0.43.3,我试图使用RCTDevSettings启用远程调试选项。

import {
   NativeModules
} from 'react-native'

在MainComponent的componentDidMount中,我进行了调用

NativeModules.RCTDevSettings.setIsDebuggingRemotely(true);

我收到以下错误

  

undefined不是一个对象(评估   ' react_native_1.NativeModules.RCTDevSettings.setIsDebuggingRemotely&#39)

我错过了什么?我不能使用开发人员菜单操作表,因为我在iMessage扩展中(不支持操作表)。

2 个答案:

答案 0 :(得分:1)

这似乎有效:NativeModules.DevMenu.debugRemotely(true)

答案 1 :(得分:0)

看来NativeModules.DevMenu在最新的RN版本中已被删除。对于Android,我们只能依靠adb shell input keyevent 82,对于iOS,我们只能依靠Ctrl + D

相关问题