React Native - 为什么更新[超出最大堆栈大小]

Dan*_*ulu 7 javascript performance stack-size reactjs react-native

我正在尝试使用React Native的Why-Did-You-Update来分析我的应用在没有必要的情况下重新渲染的位置.我使用Android模拟器来测试我的应用程序.

我在App.js中有这个代码

if (DEBUG) {
    let createClass = React.createClass;
    Object.defineProperty(React, 'createClass', {
        set: (nextCreateClass) => {
            createClass = nextCreateClass;
        }
    });
    const {whyDidYouUpdate} = require('rn-why-did-you-update');
    whyDidYouUpdate(React, { include: /^./, exclude: /^YellowBox/ });
}
Run Code Online (Sandbox Code Playgroud)

超出最大堆栈大小

在此输入图像描述

我已经理解(来自其他网站)来自包的递归被打破,(无限循环)但我无法理解为什么它在React Native中发生,因为它似乎与React一起工作.

谢谢.