Merge pull request #256 from JsSucks/reactcomponents

Fix for new context wrappers in Discord
This commit is contained in:
Alexei Stukov 2018-11-22 21:57:15 +02:00 committed by GitHub
commit 395167aafa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -131,7 +131,8 @@ class Helpers {
static findByProp(obj, what, value) {
if (obj.hasOwnProperty(what) && obj[what] === value) return obj;
if (obj.props && !obj.children) return this.findByProp(obj.props, what, value);
if (!obj.children || !obj.children.length) return null;
if (!obj.children) return null;
if (!(obj.children instanceof Array)) return this.findByProp(obj.children, what, value);
for (const child of obj.children) {
if (!child) continue;
const findInChild = this.findByProp(child, what, value);