Browse Source

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

Dima Loktev 6 years ago
parent
commit
fd71d9cf20
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      lib/ios/RNNBottomTabOptions.m

+ 4
- 1
lib/ios/RNNBottomTabOptions.m View File

@@ -19,7 +19,10 @@
19 19
 	}
20 20
 	
21 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 26
 		if (viewController.navigationController) {
24 27
 			viewController.navigationController.tabBarItem.badgeValue = badge;
25 28
 		} else {