What is Nostr?
Vic
npub1yx6…7kza
2023-12-20 18:58:11

Vic on Nostr: I have a JSX file that exports a function. Inside of it I want to assign a variable ...

I have a JSX file that exports a function.

Inside of it I want to assign a variable the result of a async function.

I cant use await without being inside an async function, which the exported function isnt.

If I wrap inside an anonymous async, I can get the result, but the promise doesnt return until after its needed for that part of page.

How do I update the page afterwards with the results?
Author Public Key
npub1yx6pjypd4r7qh2gysjhvjd9l2km6hnm4amdnjyjw3467fy05rf0qfp7kza