Trying to work out using Parse with React Native and using Back4App as my BaaS.
Running into a problem when setting up my asyncstorage (from react native).
Parse.setAsyncStorage(AsyncStorage);
//Paste below the Back4App Application ID AND the JavaScript KEY
Parse.initialize('myappid', 'sdk');
//Point to Back4App Parse API address
Parse.serverURL = 'https://parseapi.back4app.com/';
This is the initialization code I am trying to run.
Unfortunatly, I am running into this error:
App.js:14 Uncaught TypeError:
parse_react_native__WEBPACK_IMPORTED_MODULE_5___default.a.setAsyncStorage is not a function
Trying different versions of parse, different imports, different storages, nothing works. Here are my imports:
import AsyncStorage from '@react-native-async-storage/async-storage';
import Parse from 'parse/react-native';
Additional information:
I have another project working but it is running expo 40 and parse 2.19 with asyncstorage 1.17.9.
this project is running expo 46 and parse 3.4.3 with asyncstorage 1.17.10.
I want to use expo 46 for its additional features. I tried downgrading to the same versions of parse and asyncstorage but without any success.
2
Answers
Usually, it helps to rebuild the project in Xcode after
pod install
— which you had to run in this case, right?Instead of import Parse from ‘parse/react-native’;
use
import Parse from ‘parse/react-native.js’;
just adding .js