Parcourir la source

Add ability to set badge=null to hide it (#3035)

Dima Loktev il y a 7 ans
Parent
révision
fd71d9cf20
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4
    1
      lib/ios/RNNBottomTabOptions.m

+ 4
- 1
lib/ios/RNNBottomTabOptions.m Voir le fichier

19
 	}
19
 	}
20
 	
20
 	
21
 	if (self.badge) {
21
 	if (self.badge) {
22
-		NSString *badge = [RCTConvert NSString:self.badge];
22
+		NSString *badge = nil;
23
+		if (self.badge != nil && ![self.badge isEqual:[NSNull null]]) {
24
+			badge = [RCTConvert NSString:self.badge];
25
+		}
23
 		if (viewController.navigationController) {
26
 		if (viewController.navigationController) {
24
 			viewController.navigationController.tabBarItem.badgeValue = badge;
27
 			viewController.navigationController.tabBarItem.badgeValue = badge;
25
 		} else {
28
 		} else {