I’m using moralis verison 0.0.183 and react-moralis version 0.3.11. I’m trying to do a simple email password login with
const login = async () => {
try {
const curr_user = await Moralis.User.logIn(userEmail, userPassword, { usePost: true });
navigation.navigate("Camera");
} catch (error) {
const code = error.code;
const message = error.message;
setLoginError(true);
setErrorText(message);
}
}
However, when I do I get an error saying can’t find variable localStorage. So I added the following lines
const Moralis = require('moralis/react-native.js');
const AsyncStorage = require('react-native').AsyncStorage;
Moralis.setAsyncStorage(AsyncStorage);
But still getting the same error, any ideas?