这是我发送给Firebase的提交表单:
enter code heresubmitForm = async () => {
const reg = /^\+?3?8?(0\d{9})$/
if(!this.state.phone.match(reg)) {
Alert.alert('Error', 'Wrong phone number !')
} else if( this.state.username.length < 1) {
Alert.alert('Error', 'Username has to be not empty !')
} else {
await AsyncStorage.setItem('userPhone', this.state.phone)
User.phone = this.state.phone
firebase.database().ref('users/' + User.phone).set({ username: this.state.username })
this.props.navigation.navigate('App')
}
}
我看到两个错误
Async-Storage
包有关。请尝试使用最新的。async-storage
的最新链接您可以使用https://react-native-async-storage.github.io/async-storage/docs/install