小编klo*_*aks的帖子

为什么我得到"undefined不是一个对象(评估PropTypes.shape)"?

每当我尝试运行我的iOS模拟器时,我都会收到该错误.所有模块都已安装,我的图片的文件路径是正确的,除了我的模拟器中出现的错误外,我的IDE中没有错误.图片下面的错误.

错误图片

这是Login.js:

import React, {Component} from 'react';
import {StyleSheet, TextInput, Text, TouchableOpacity, KeyboardAvoidingView} from 'react-native';

class Login extends Component {
    onButtonPress() {
        this.props.navigator.push({
            id: 'CreateAccount'
        });
    }

    render() {
        return(
            <KeyboardAvoidingView behavior={"padding"} style={styles.container}>
                    <TextInput
                        style={styles.input}
                        returnKeyType={"next"}
                        keyboardType={"email-address"}
                        autoCorrect={false}
                        placeholder={"Email"}
                    />

                    <TextInput
                        style={styles.input}
                        returnKeyType={"go"}
                        placeholder={"Password"}
                        secureTextEntry
                    />

                    <TouchableOpacity>
                        <Text style={styles.loginAndCA}>Login</Text>
                    </TouchableOpacity>

                    <TouchableOpacity onPress={this.onButtonPress.bind(this)}>
                        <Text style={styles.loginAndCA}>Create Account</Text>
                    </TouchableOpacity>
            </KeyboardAvoidingView>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        padding: 20 // Length of text input boxes.
    },

    input: …
Run Code Online (Sandbox Code Playgroud)

javascript ios webstorm reactjs react-native

8
推荐指数
2
解决办法
6246
查看次数

标签 统计

ios ×1

javascript ×1

react-native ×1

reactjs ×1

webstorm ×1