From 6c5e5329c251a2469e5773ea487d06e06d32d1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Camilo=20Guarin=20Pe=C3=B1aranda?= Date: Tue, 7 Nov 2017 22:05:28 -0500 Subject: [PATCH] Adding support for RN 0.50+ Added other try-catch to require the correct library for React Native 0.50+, as posted on [#496](https://github.com/parse-community/Parse-SDK-JS/issues/496) --- src/StorageController.react-native.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/StorageController.react-native.js b/src/StorageController.react-native.js index 7c2c6a1b8..9ea7969f8 100644 --- a/src/StorageController.react-native.js +++ b/src/StorageController.react-native.js @@ -17,7 +17,12 @@ try { // for React Native 0.43+ AsyncStorage = require('react-native/Libraries/react-native/react-native-implementation').AsyncStorage; } catch (error) { - AsyncStorage = require('react-native/Libraries/react-native/react-native.js').AsyncStorage; + try { + AsyncStorage = require('react-native/Libraries/react-native/react-native.js').AsyncStorage; + } catch(error) { + // for React Native 0.50+ + AsyncStorage = require('react-native/Libraries/Storage/AsyncStorage'); + } } var StorageController = {