Vic :Cacodemon: :doomguy: 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?
Published at
2023-12-20 18:58:11Event JSON
{
"id": "88df43c09205a0d04a6dad514a8ea494b90d7524c8b79bc744a6332a64f396cc",
"pubkey": "21b419102da8fc0ba90484aec934bf55b7abcf75eedb39124e8d75e491f41a5e",
"created_at": 1703098691,
"kind": 1,
"tags": [],
"content": "I have a JSX file that exports a function.\n\nInside of it I want to assign a variable the result of a async function.\n\nI cant use await without being inside an async function, which the exported function isnt.\n\nIf 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.\n\nHow do I update the page afterwards with the results?",
"sig": "5fc6e2aeb33af755b9ac725528f0759344290d3905b40ef532fade6eadf9135e321784625f801fd0c26b17f25255b31bd695d9f1a02fffd5214f3c7d68fdd007"
}