【发布时间】:2018-11-23 01:40:15
【问题描述】:
我正在使用 React Native 开发一个 Android 和 IOS 移动应用程序。我想为我的数据库使用 Firebase,但是当我安装 npm install --save firebase 然后我安装 import firebase from 'firebase' 时。
我会收到这个错误提示
"TypeError: undefined is not a function(evalating '_iteratortypeof 符号===“功能”? Symbol.iterator: "@@iterator"')"
这是我的输出截图
我想使用数据库为我的应用程序创建一个登录屏幕。如果将 Firebase 用于我的移动应用,任何其他建议都会有所帮助。
如果有帮助,这是我的编码。
import React from 'react';
import {
View,
Text,
StyleSheet,
Platform,
TextInput,
TouchableOpacity,
} from 'react-native';
import firebase from 'firebase';
export default class Login extends React.Component {
constructor(props) {
super(props);
}
state = {
email: "Enter email",
password: "Enter password"
};
render() {
return (
<View style={styles.container}>
<View style={styles.textContainer}>
<Text style={styles.text}>Create an account below</Text>
<TextInput
style={styles.textInput}
onChangeText={(text) => this.setState({ email: text })}
value={this.state.email}
/>
<TextInput
style={styles.textInput}
onChangeText={(text) => this.setState({ password: text })}
value={this.state.password}
/>
<TouchableOpacity
>
<View>
<Text>Log In Existing</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
>
<View>
<Text>Create New User</Text>
</View>
</TouchableOpacity>
</View>
</View>
);
}}
【问题讨论】:
-
Outra here the content of your file that has import...
标签: firebase react-native