компонент не определен реагировать нативный - PullRequest
0 голосов
/ 28 января 2019

Я создал пустую страницу и пытаюсь импортировать компонент другой страницы в пустую.

App.js

import React, {Component} из'act ';import {name as appName} из './app.json' ;

import {

    View,
    Text,
    StyleSheet,
    TextInput,
    Button,
    TouchableOpacity,
    AppRegistry

} из'act-native ';

import Login from "./Login";

функция validate () {

alert("Button Clicked...")
console.log("Hello world!")

}

класс экспорта по умолчанию Приложение расширяет Компонент {

render(){

    return(


        <Login />

        );

}

} ​​

const styles = StyleSheet.create ({

container: {

    // justifyContent: 'center',
    // alignItems: 'center',
    backgroundColor: '#af522a',
    flex: 1

},
txtText: {

    textAlign: 'center',
    fontSize: 25,
    color: '#9daf2a'

},
txtInput: {

    height: 45,
    borderColor: '#9daf2a',
    borderWidth: 3,
    marginTop: 75,
    padding: 12,
    backgroundColor: '#FFFFFF',
    marginLeft: 16,
    marginRight: 16,
    borderRadius: 15
},
txtInput2: {

    height: 45,
    borderColor: '#9daf2a',
    borderWidth: 3,
    padding: 12,
    backgroundColor: '#FFFFFF',
    marginLeft: 16,
    marginRight: 16,
    marginTop: 24,
    borderRadius: 15

},
loginScreenButton:{
marginRight:40,
marginLeft:40,

marginTop: 45, paddingTop: 10, paddingBottom: 10, backgroundColor: '# 593eb2', borderRadius: 10, borderWidth: 1, borderColor: '#fff'}, loginText: {color: '# fff', textAlign: 'center', paddingLeft: 10, paddingRight: 10}

})

Login.js

import React, {component} из 'response';import {

View,
TextInput,
StyleSheet

} из'act-native ';

экспорт класса по умолчанию Вход расширяет Компонент {

render(){


    return(

        <View style = {styles.container}>
        </View>

        )

}

}

const стили= StyleSheet.create ({

container: {background: "#44c41d", flex: 1}

})

Ошибка

enter image description here

Я только началс реагировать родной и не так много знаний.поэтому, пожалуйста, скажите мне, если у кого-нибудь есть какое-либо решение.

Заранее спасибо.

1 Ответ

0 голосов
/ 28 января 2019

в вашем Login.js, вы используете строчный компонент,

import React, {component} from 'react'

конвертируете его в верхний регистр.

import React, {Component} from 'react'; 
...