Handling React Dialog Flows with async/await
typescript
dev.to
React dialogs often start simple. You add an isOpen state, then a selected item state, then confirm/cancel callbacks, then another dialog after the first one. Eventually, a simple flow can become scattered across multiple components. For example, a user flow like this: Select a user Confirm the action Add the user often becomes multiple pieces of state: const [isUserSearchOpen, setIsUserSearchOpen] = useState(false); const [isConfirmOpen, setIsConfirmOpen] = useState(false); const [sel