You can still do this with React, though. It's quite easy (and useful!) to have components which implement some dialog which pops up when you call an async function, which only resolves once the user has finished interacting with that dialog. The code could, for example, be essentially identical to your example. It also isn't in contradiction with the nature of React at all, projects that use React are full of imperative code. React just frees you from having to maintain the connection between UI state and your data manually in an imperative manner.