admin管理员组文章数量:1279042
I am new in React-Native. and I am trying to set image delay to load function in react native.
<Image style={{ width:250, height: 250 }}
source={require('../images/cart.png')}
onLoad={() => {
this.props.navigation.navigate('HomeScreen')
}}
/>
I am trying this but it gets an error
onLoad={() => {
setTimeout(function(){
this.props.navigation.navigate('HomeScreen')
}, 3000);
}}
I am new in React-Native. and I am trying to set image delay to load function in react native.
<Image style={{ width:250, height: 250 }}
source={require('../images/cart.png')}
onLoad={() => {
this.props.navigation.navigate('HomeScreen')
}}
/>
I am trying this but it gets an error
onLoad={() => {
setTimeout(function(){
this.props.navigation.navigate('HomeScreen')
}, 3000);
}}
Share
Improve this question
edited Aug 4, 2021 at 3:24
Federico Baù
7,7355 gold badges40 silver badges48 bronze badges
asked Oct 4, 2018 at 11:01
Rushi daveRushi dave
1642 gold badges6 silver badges20 bronze badges
1
- @ShibinRajuMathew redirect after sometimes – Rushi dave Commented Oct 4, 2018 at 11:07
1 Answer
Reset to default 10Can you try this arrow function notation
setTimeout(() => {
this.props.navigation.navigate('HomeScreen');
}, 3000);
本文标签: javascripthow to set timeout function in react nativeStack Overflow
版权声明:本文标题:javascript - how to set timeout function in react native - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741268844a2368930.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论