DEV Community

React Hooks with Async-Await

vinodchauhan7 on September 23, 2019

Picture this, You have text box which can give list books from google store based on what you type on it. If no book available on that particular s...
Collapse
 
aderchox profile image
aderchox • Edited

Thank you so much. I've also made a quick and minimal working example for future visitors here:
codesandbox.io/s/react-async-custo...
Loading is not necessary unless specifically needed, so in the sandbox above I've removed the loading from one of the hooks.

Collapse
 
nikhilknoldus profile image
Nikhil

It was useful for me, I wanted to use async in useEffect for api call.
Thanks

Collapse
 
baavgai profile image
Baavgai

Thank you! This solved a major issue for me. Very helpful.

Collapse
 
avkonst profile image
Andrey

You might be interested in to consider Hookstate, which supports Promise in useState: hookstate.js.org/docs/asynchronous...

Collapse
 
eliastapiaeta profile image
Elías Tapia Aguilera

Thank very much!!!