ahh the function wrapping that should also be async, so it should be like:
const useRequest = async () => { const res = await request() } useRequest()
given that you return the json instead of just logging it in the request() function.
json
request()
Exactly what I needed to know too - thanks!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
ahh the function wrapping that should also be async, so it should be like:
given that you return the
json
instead of just logging it in therequest()
function.Exactly what I needed to know too - thanks!