- 16:40
- -
- 16:55
In modern web development, managing user interactions through modals and dialogs is a common yet often cumbersome task.
Traditional methods in React involve maintaining "open" states and handling outcomes through "onClick" events.
This approach, especially when dealing with complex user flows or multiple confirm steps, quickly becomes unwieldy, reminiscent of the callback patterns of old server-side interactions.
With the evolution of asynchronous programming, the use of callbacks has been largely supplanted by the more elegant and readable async/await pattern for server calls.
Why not apply the same evolution to how we handle user interactions in React?
In this talk, we propose a transformative approach: utilizing dialogs as awaitable promises. This method allows developers to write intuitive and linear business logic, akin to using if (await dialog("question")) {...} for handling user inputs, streamlining the process of complex user flows and decision trees within applications.
Coder, open-sourcerer, developer experience enthusiast, software architect, and entrepreneur. At work, I oversee and consult in enterprise legacy systems modernization for fortune 500s to small businesses. Outside work I love helping NGOs as a full-stack developer and mentor.