我正在尝试使用Why-Did-You-Update 和 React Native 来分析我的应用在不需要时重新渲染的位置。我使用 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/ });
}
超过最大堆栈大小
我已经(从其他站点)了解到包的递归性被破坏了(无限循环),但我不明白为什么它会在 React Native 中发生,因为它似乎正在使用 React。
谢谢。