I have the following function taken from (Iterate through Nested JavaScript Objects) implemented in a plain CRNA project:
var findObjectByLabel = function(obj, label) {
if(obj.label === label) { return obj; }
for(var i in obj) {
if(obj.hasOwnProperty(i)){
var foundLabel = findObjectByLabel(obj[i], label);
if(foundLabel) { return foundLabel; }
}
}
return null;
};
When i try to execute this code in the constructor or any lifecycle method, the app crashes with Maximum Call Stack Size exceeded. Is this something that is not allowed in RN? Will I have to convert this into an iterative version?