Javascript 获取登录屏幕的typeError?

Javascript 获取登录屏幕的typeError?,javascript,reactjs,react-native,Javascript,Reactjs,React Native,在输入emailID和密码后,我已经创建了登录屏幕。用户应该能够登录,并且应该能够查看VenueList组件,即所有场馆的列表。我正在使用auth0进行身份验证。我收到类型错误,如何修复 我已经创建了VenueList组件,输入电子邮件和密码后应该可以查看该组件 Login.js: import React, { Component } from "react"; import { View, Text, StyleSheet, Button, TextInput, KeyboardAv

在输入emailID和密码后,我已经创建了登录屏幕。用户应该能够登录,并且应该能够查看VenueList组件,即所有场馆的列表。我正在使用auth0进行身份验证。我收到类型错误,如何修复

我已经创建了VenueList组件,输入电子邮件和密码后应该可以查看该组件

Login.js:

    import React, { Component } from "react";
import { View, Text, StyleSheet, Button, TextInput, KeyboardAvoidingView, ActivityIndicator } from "react-native";
import Auth0 from "react-native-auth0";

var credentials = require('./auth0-credentials');
const auth0 = new Auth0(credentials);

export default class Login extends Component {

    constructor(props) {
        super(props);
        this.state = { accessToken: null };
    }

    _onLogin = () => {
        auth0.webAuth
          .authorize({
            scope: 'openid profile',
            audience: 'https://' + credentials.domain + '/userinfo'
          })
          .then(credentials => {
            Alert.alert(
              'Success',
              'AccessToken: ' + credentials.accessToken,
              [{ text: 'OK', onPress: () => console.log('OK Pressed') }],
              { cancelable: false }
            );
            this.setState({ accessToken: credentials.accessToken });
          })
          .catch(error => console.log(error));
    };

    _onLogout = () => {
        if (Platform.OS === 'android') {
          this.setState({ accessToken: null });
        } else {
          auth0.webAuth
            .clearSession({})
            .then(success => {
              this.setState({ accessToken: null });
            })
            .catch(error => console.log(error));
        }
    };

    render() {
        let loggedIn = this.state.accessToken === null ? false : true;
            return (
            <View style={styles.container}>
                <Text style={styles.header}>Auth0Sample - Login</Text>
                <Text>
                You are {loggedIn ? '' : 'not '}logged in.
                </Text>
                <Button
                onPress={loggedIn ? this._onLogout : this._onLogin}
                title={loggedIn ? 'Log Out' : 'Log In'}
                />
            </View>
            );
    }

}
截图:


尝试此命令并重新生成

这可能是由于链接库时出错,请尝试执行手动linking@PritishVaidya我不熟悉reactNative什么是手动链接?这里按照本文中的步骤进行,重建并运行可能是因为域名不正确或为空,如中所示screenshot@PritishVaidya我的名字是正确的。在.env文件中,我添加了
AUTH0\u DOMAIN=“xyz.AUTH0.com”
module.exports = {
clientId: "{AUTH0_CLIENT_ID}",
domain: "{AUTH0_DOMAIN}"  
};
react-native link react-native-sensitive-info