Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Calculating state happens to late

const constructor = async () => {
   await refreshToken();
         
   for(let i = 0; i<favourite.length; i++) {
       if(favourite[i].id === subject.id) setLiked(true)
   }
}
constructor().then(() => setHasloaded(true)).catch(e => console.log(e))
 
PREVIOUS NEXT
Tagged: #Calculating #state #late
ADD COMMENT
Topic
Name
2+7 =