From 82f3964f2da8b93b2cd2b6a8d1c9cdb5c2aa6f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0imo?= Date: Sun, 16 Apr 2017 15:25:05 -0700 Subject: [PATCH] Change Promise.done to Promise.then Summary: - [X] Explain the **motivation** for making this change. - [X] Provide a **test plan** demonstrating that the code is solid. - [X] Match the **code formatting** of the rest of the codebase. - [X] Target the `master` branch, NOT a "stable" branch. `Promise.done` is non-standard, `Promise.then` is preferred as a standardized method. On Android, polyfill filling in `Promise.done` has been most probably taken out in newer versions of `react-native` and app crashes when it tries to query network state through `NetInfo`. No tests are required for this change. Closes https://github.com/facebook/react-native/pull/13489 Differential Revision: D4897566 Pulled By: mkonicek fbshipit-source-id: 140720d7367cd1d9bf8924ec8a118c1bff4e461d --- Libraries/Network/NetInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js index 4d1df4ae3..c10166a53 100644 --- a/Libraries/Network/NetInfo.js +++ b/Libraries/Network/NetInfo.js @@ -79,7 +79,7 @@ const _isConnectedSubscriptions = new Map(); * NetInfo exposes info about online/offline status * * ``` - * NetInfo.fetch().done((reach) => { + * NetInfo.fetch().then((reach) => { * console.log('Initial: ' + reach); * }); * function handleFirstConnectivityChange(reach) {