On my profile screen, I have implemented a code to save users in the database. The code works perfectly on iOS but throws an error on Android stating "Possible unhandled Promise Rejection" with "TypeError: Symbol.asyncIterator is not defined." Can someone help me resolve this issue on Android and enable successful data saving? My project is based on React Native. Here is a snippet of the code:
import {Auth, DataStore} from 'aws-amplify';
const ProfileScreen = () => {
const [name, setName] = useState('');
const [bio, setBio] = useState('');
const [gender, setGender] = useState();
const [lookingfor, setLookingfor] = useState();
const isValid = () => {
return name && bio && gender && lookingfor;
};
const save = () => {
if(!isValid()) {
console.warn('Not valid');
return;
}
const newUser = new User({
name,
bio,
gender,
lookingfor,
image: 'https://notjustdev-dummy.s3.us-east-2.amazonaws.com/avatars/elon.png',
});
DataStore.save(newUser);
};
return ...