Global Feed Post Login
Replying to Avatar Nice and Kind Vic

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?

Avatar
jimbocoin 🃏 2y ago

This sounds like a JavaScript question. What does JSX have to do with it?

Reply to this note

Please Login to reply.

Discussion

Avatar
average_bitcoiner 2y ago

Has to do with component lifecycle and reactivity of the underlying data

Thread collapsed