Hacker News new | past | comments | ask | show | jobs | submit login

>I've got no idea how you'd do that in React.

It's simple, you can place a component that provides dialogs near the root of your component tree and provide async functions which open such dialogs to the descendant components (e.g. via contexts). These functions can then be made to resolve only when the dialogs are closed. Thus, all descendant components can use dialogs in the same manner as shown in your example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: