Javascript I';I’使用“I”时出错;超级(道具)“;以自然反应

Javascript I';I’使用“I”时出错;超级(道具)“;以自然反应,javascript,react-native,Javascript,React Native,当我按照本教程制作应用程序时。我犯了一个错误 我还看到一些超级(道具)的台词;在VS代码中 这是我的代码,请纠正我的代码来解决问题,因为我还是个初学者 import React, { Component } from 'react'; import { AppRegistry } from 'react-native'; import Splash from './components/splash'; import Home from './components/index'; clas

当我按照本教程制作应用程序时。我犯了一个错误

我还看到一些超级(道具)的台词;在VS代码中

这是我的代码,请纠正我的代码来解决问题,因为我还是个初学者

import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import Splash from './components/splash';
import Home from './components/index';

class Main extends Component {
  constructor(props) {
    super(props);
    this.state = { CurrentScreen: 'Splash' };
    console.log('Moving to next screen...');
    setTimeout(()=>{
      console.log('Done!');
      this.setState({ CurrentScreen: 'Home' });
    }, 3000)
  }
  render() {
    const { CurrentScreen } = this.state
    let mainScreen = CurrentScreen === 'Splash' ? <Splash /> : <Home />
    return mainScreen
  }
}

AppRegistry.registerComponent('App', () => Splash)

import React,{Component}来自'React';
从“react native”导入{AppRegistry};
从“/components/Splash”导入飞溅;
从“./components/index”导入主目录;
类主扩展组件{
建造师(道具){
超级(道具);
this.state={CurrentScreen:'Splash'};
log('移动到下一个屏幕…');
设置超时(()=>{
console.log('Done!');
this.setState({CurrentScreen:'Home'});
}, 3000)
}
render(){
const{CurrentScreen}=this.state
让mainScreen=CurrentScreen==‘飞溅’?:
返回主屏幕
}
}
AppRegistry.registerComponent('App',()=>Splash)

非常感谢。

避免将错误作为图像。我确信这个错误也会出现在控制台中。把它换成图片。错误与超级无关。您的代码没有导出行。可能正在导出组件并查看错误是否消失?导出默认主;您确定:AppRegistry.registerComponent('App',()=>Splash)???那么Main()做什么呢?是不是AppRegistry.registerComponent('App',()=>Main)??请告诉我,我不知道我刚刚学习了这个教程,但是我发现了一个错误。