I have an electron application where I need to send a lot of data through UDP. This process is started through a click of a button in my React UI, and this example simplifies my problem. My React button:
<button
onClick={() => {
foo();
}}
>
Run foo
</button>;
Foo function:
export const foo = async () => {
while (true) {
console.log("hello");
}
};
While foo is asynchronous, it still freezes the React UI!