RN 0.18.0的Devtool有没有人有这个问题?

时间:2016-01-22 05:19:49

标签: react-native

我使用iPhone 4和iPhone 6来测试一个非常简单的APP,如果有什么不可用的话我会听键盘事件。

componentWillMount:function() {
        StatusBarIOS.setHidden( true);

        DeviceEventEmitter.addListener('keyboardDidShow',(frames)=>{
            console.log( "keyboardDidShow frames: " + frames );

        });
        DeviceEventEmitter.addListener('keyboardWillHide',(frames)=>{
            console.log( "keyboardWillHide frames: " + frames );
        });
    },

当我激活Devtool时,Chrome已经充满了这条消息并且它一直在继续。 这个无休止的警告无法看到我的日志信息。

Running application "Project18" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
YellowBox.js:57 jsSchedulingOverhead (-1766ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
3YellowBox.js:57 jsSchedulingOverhead (-1767ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1766ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1762ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1766ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1767ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1766ms) should be positive
3YellowBox.js:57 jsSchedulingOverhead (-1767ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
2YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1764ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1767ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
2YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1766ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1767ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1765ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1767ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1770ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1735ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1767ms) should be positive
YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive
2YellowBox.js:57 jsSchedulingOverhead (-1769ms) should be positive
3YellowBox.js:57 jsSchedulingOverhead (-1768ms) should be positive

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。他们反复向你展示这样一个警告(没有任何背景,没有办法谷歌并找出如何解决它),这有点奇怪。

我的解决方案"不是解决方案,而是我只是禁用了警告。你可以找到有问题的code here。所以,作为一个快速修复,您可以转到node_modules/react-native/React/Modules/RCTTiming.m,找到有问题的行(对我来说就是第187行),然后将其注释掉。

if (jsSchedulingOverhead < 0) {
  // RCTLogWarn(@"jsSchedulingOverhead (%ims) should be positive", (int)(jsSchedulingOverhead * 1000));

  /**
   * Probably debugging on device, set to 0 so we don't ignore the interval
   */
  jsSchedulingOverhead = 0;
}

在你决定再次升级React Native之前,它会解决它。

可能值得关注一个实际解决问题而不是拍摄信使的解决方案,但这应该让你现在恢复正常运行。