Javascript React Native:将组件导入App.js时出错

Javascript React Native:将组件导入App.js时出错,javascript,reactjs,react-native,Javascript,Reactjs,React Native,从组件导入默认类时出错 使用expo,我搜索此错误,但没有解决问题,组件返回对象 类型无效--需要字符串(对于内置组件)或类/函数(对于复合组件)但得到:object 错误: 12:19:03: Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: obj

从组件导入默认类时出错 使用expo,我搜索此错误,但没有解决问题,组件返回对象

类型无效--需要字符串(对于内置组件)或类/函数(对于复合组件)
但得到:object

错误:

12:19:03: Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check your code at registerRootComponent.js:35.
    in ExpoRootComponent (at renderApplication.js:33)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:32)
App.js

import Login from './app/components/login';
import React, {Component} from 'react';
import {Text, View} from 'react-native';

export default class Login extends Component {
    constructor(props){
        super(props);
        this.state = {}
    }
    render(){
        return(
            <View>
             <Text>Login</Text>
            </View>
        )
    }
}
app/components/login/index.js

import Login from './app/components/login';
import React, {Component} from 'react';
import {Text, View} from 'react-native';

export default class Login extends Component {
    constructor(props){
        super(props);
        this.state = {}
    }
    render(){
        return(
            <View>
             <Text>Login</Text>
            </View>
        )
    }
}
import React,{Component}来自'React';
从“react native”导入{Text,View};
导出默认类登录扩展组件{
建造师(道具){
超级(道具);
this.state={}
}
render(){
返回(
登录
)
}
}

App.js
中,对
登录
组件使用默认导入。另外,从
App.js

import React from "react";
import Login from './app/components/login';

export default class App extends React.Component {
  render() {
    return <Login/>;
  }
}
从“React”导入React;
从“./app/components/Login”导入登录名;
导出默认类App扩展React.Component{
render(){
返回;
}
}

没什么,只有一行输入。