Я новичок в React Native.Я следую этому руководству https://www.youtube.com/watch?v=bZj6uzNRs5E&t=337s, чтобы связать мое приложение с firebase.
Но мое приложение показывает ошибку "Неожиданный токен (31:13)"
Я обновил свой код и сохранилэто все еще, я получаю то же самое сообщение об ошибке.Я много раз менял свой код, но сообщение об ошибке каждый раз было одинаковым.
Ниже приведен полный код кода app.js
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import * as firebase from 'firebase';
import {Container, Content, Header, Form, Input, Item, Button, Label } from 'native-base';
export default class App extends React.Component{
constructor(props){
super(props)
this.state = ({
// firstName='',
// lastName='',
email='',
password=''
//confirmPassword='',
})
}
signUpUser = (/*firstName,lastName,*/email,password/*,confirmPassword*/) => {
try {
if(this.state.password.length<6){
alert("please enter atleast 6 character")
}
firebase.auth().createUserWithEmailandPassword(email,password)
} catch (error) {
console.log(error.toString[])
}
}
render() {
return (
<Container styles={styles.container}>
<Form>
<Item floatingLabel>
<Label>First Name</Label>
<Input
autoCorrect={false}
autoCapitalize='none'
onChangeText={(firstName) => this.setState{(firstName)}}
/>
</Item>
<Item floatingLabel>
<Label>Last Name</Label>
<Input
autoCorrect={false}
autoCapitalize='none'
onChangeText={(lastName) => this.setState{(lastName)}}
/>
</Item>
<Item floatingLabel>
<Label>Email</Label>
<Input
autoCorrect={false}
autoCapitalize='none'
onChangeText={(email) => this.setState{(email)}}
/>
</Item>
<Item floatingLabel>
<Label>Password</Label>
<Input
secureTextEntry={true}
autoCorrect={false}
autoCapitalize='none'
onChangeText={(password) => this.setState{(password)}}
/>
</Item>
<Item floatingLabel>
<Label>Confirm Password</Label>
<Input
secureTextEntry={true}
autoCorrect={false}
autoCapitalize='none'
onChangeText={(confirmPassword) => this.setState{(confirmPassword)}}
/>
</Item>
<Button style={{marginTop: 10}}
full
rounded
success
onPress = {() => this.signUpUser(this.state.email,/* this.state.firstName, this.state.lastName,*/this.state.password/*,this.state.confirmPassword*/)}
><Text>Sign Up</Text>
</Button>
</Form>
</Container>
);
}
}
, пожалуйста, помогите мне, если кто-нибудь узнает об этом.