From 336dbe4c00484feec84037e1f23deaf895a9a11a Mon Sep 17 00:00:00 2001 From: Laurence Bortfeld Date: Wed, 9 Mar 2016 16:29:06 -0800 Subject: [PATCH] getCurrentConnectivity should resolve with object Summary:`getCurrentConnectivity()` should resolve with object instead of array otherwise in `NetInfo.fetch().done(reach => console.log('Initial: ' + reach))` `reach` will be undefined (see https://github.com/l-urence/react-native/blob/master/Libraries/Network/NetInfo.js#L200). cc satya164 Closes https://github.com/facebook/react-native/pull/6373 Differential Revision: D3032773 fb-gh-sync-id: edc545548d3c17387545b6c59894c27e4563cb18 shipit-source-id: edc545548d3c17387545b6c59894c27e4563cb18 --- Libraries/Network/RCTNetInfo.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Network/RCTNetInfo.m b/Libraries/Network/RCTNetInfo.m index 067996b6c..c5440ce5d 100644 --- a/Libraries/Network/RCTNetInfo.m +++ b/Libraries/Network/RCTNetInfo.m @@ -90,7 +90,7 @@ static void RCTReachabilityCallback(__unused SCNetworkReachabilityRef target, SC RCT_EXPORT_METHOD(getCurrentConnectivity:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject) { - resolve(@[@{@"network_info": _status}]); + resolve(@{@"network_info": _status}); } @end