找不到文件:Lesson / index.js

时间:2017-12-11 17:04:17

标签: javascript android react-native mobile expo

这肯定是一个愚蠢的错误,但它非常令人沮丧,因为一切都很完美,没有改变任何东西,它就停止了工作。 我从Lesson.js文件中导入了Lesson模块。

它给我的错误是:

  

加载依赖项时出错:错误:找不到文件:Lesson / index.js

这是我的代码:

import React from 'react';
import { Button, View, Text } from 'react-native';
import StackNavigator from 'react-navigation'; // 1.0.0-beta.21
import Lesson from './Lesson';


export class Home extends React.Component {
  static navigationOptions = {
    title: 'Welcome',
    header: null
  };
  render() {
    const { navigate } = this.props.navigation;
    return (
      <View>
        <Text>Hello, Chat App!</Text>
        <Button onPress={() => navigate('Lesson')} title="Start Lesson"/>
      </View>
 )}
} 

const Nav = StackNavigator({
  Home: { screen: Home },
  Lesson: { screen: Lesson, navigationOptions: { header: null } }
});

export default class App extends React.Component {
  render() {
    return <Nav/>;
  }
}

0 个答案:

没有答案