Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6213

setInterval not working with async funtion in react native

$
0
0

I am just learning to react native and I am trying to record video and show remaining video duration in the screen.

I am using the below code:

setInterval (() => {                    this.setState ({progress: progress * 2});                  }, 1000);                  var video = await this.camera.recordAsync ({                    mute: true,                    quality: '480p',                    maxDuration: this.state.max_duration,                  });

However video is recording perfectly fine, but setiInterval has stopped worked. How to run setInterval in a async funtion ? Please help..


Viewing all articles
Browse latest Browse all 6213

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>