mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 20:35:43 +08:00
[ReactNative] Use RCTNullIfNill and (id)kCFNull
Summary: @public Use consistent `null` handling: `value || null` -> `RCTNullIfNil(value)` `value == null ? nil : value` -> `RCTNilIfNull(value)` `[NSNull null]` -> `(id)kCFNull` Test Plan: The tests should be enough.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#import "RCTBridge.h"
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTUtils.h"
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
|
||||
|
||||
@@ -172,7 +173,7 @@ RCT_EXPORT_METHOD(checkPermissions:(RCTResponseSenderBlock)callback)
|
||||
- (NSDictionary *)constantsToExport
|
||||
{
|
||||
return @{
|
||||
@"initialNotification": _initialNotification ?: [NSNull null]
|
||||
@"initialNotification": RCTNullIfNil(_initialNotification),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user