[英]React Native - SetTimeout variable not found
Trying to load a splash screen for a set amount of time but error reads ReferenceError: Can't find variable: SetTimeout.尝试在设定的时间内加载启动画面,但错误读取 ReferenceError:找不到变量:SetTimeout。
import React, { Component } from 'react';
import { Image, View } from 'react-native';
import { inject } from 'mobx-react';
@inject("stores")
export default class SplashScreen extends Component {
constructor(props) {
super(props)
}
componentDidMount() {
const { stores, navigation } = this.props;
SetTimeout (() => {
navigation.navigate("Login")
}, stores.config.SplashTime)
}
render() {
const { stores } = this.props
return (
<View style={{flex: 1}}>
<Image style={{flex: 1, width: null, height: null}} source={stores.config.SplashIMG}/>
</View>
)
}
}
The spelling for setTimeout is incorrect as SakoBu pointed out!正如 SakoBu 指出的那样,setTimeout 的拼写不正确! Method names are case sensitive.方法名称区分大小写。 Also try window.setTimeout if that does not fix the problem.如果不能解决问题,也可以尝试 window.setTimeout。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.