Posts by cbdeveloper • 126 points
2 posts
-
0
votes1
answer42
viewsA: Is it possible to use ASYNC AWAIT when receiving a PROMISE return?
I think you need to actually return to Promise. Something more or less like this: const returnAPromise = () => { return new Promise((resolve,reject) => { setTimeout(() => { resolve("ASYNC…
-
1
votes1
answer253
viewsA: Is it correct to use useCallback within a custom hook?
I think your problem is in: const useCounter = () => { const methods = { // DESSA MANEIRA ... // ESSA VARIÁVEL VAI SER SEMPRE RECRIADA E }; // SUA REFERÊNCIA VAI MUDAR A CADA render DE useCounter…