Don't return empty string for accessibilityLabel for RCTView

Summary:
In case `RCTView` had no subviews, `RCTRecursiveAccessibilityLabel` was returning an empty string rather than nil.

I've noticed that https://fburl.com/i95iynxi returns empty string as well. Shall we change it there as well?

Reviewed By: shergin

Differential Revision: D15337865

fbshipit-source-id: 8e38a88321f3dcfdf35a38d43fdbe4f5118796f1
This commit is contained in:
Samuel Susla
2019-05-20 01:40:52 -07:00
committed by Facebook Github Bot
parent 4a5d0bdbd7
commit d4ff5ed258
+1 -1
View File
@@ -95,7 +95,7 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view)
[str appendString:label];
}
}
return str;
return str.length == 0 ? nil : str;
}
@implementation RCTView