Recurrence function in React Native -


i add recurrence function in react native project, settimeout doesn't work. can tell me why? , how fix it?

handleappstatechange(appstate) {     if(appstate === 'background') {         let = 0;         function runaction() {             i++;             console.log('result'+i);             settimeout("runaction()",1000);         }         runaction();     } }  

first argument of settimeout function, try to

settimeout(runaction,1000); 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -