Closed jeffdgr8 closed 3 years ago
This code:
useEffect { scope.launch { setShoppingList(getShoppingList()) } }
causes an infinite loop, repeatedly calling the GET endpoint and updating the state, triggering the update over and over again.
Using useEffectOnce instead will resolve this.
useEffectOnce
useEffectOnce { scope.launch { setShoppingList(getShoppingList()) } }
Thanks so much! We’ve completely overhauled this tutorial to be compatible with the latest version of the wrappers, which also fixes this! I appreciate y’all pointing it out.
This code:
causes an infinite loop, repeatedly calling the GET endpoint and updating the state, triggering the update over and over again.
Using
useEffectOnce
instead will resolve this.