desko27/react-call — reverse-engineered prompt
Reverse engineered prompt
Build me a small React and TypeScript helper library that lets me use UI components like async functions. I want to be able to turn something like a confirm dialog, toast, picker, drawer, or simple form modal into a callable component, render a root once in the app, then do something like await a call and get a value back when the user finishes.
Please make it feel clean and lightweight, with strong typing, no extra runtime dependencies if possible, and support for normal React apps plus SSR friendly setups. It should let the component end itself, let the caller end or update an active call, and have a single instance mode for things like loading toasts or notifications. If there is an exit animation, it should wait before unmounting.
I would also like a few polished examples and docs so people can quickly understand the pattern, especially a confirm dialog, a toast, and a multi step flow. Look up current docs online if you need to.
Want more depth? Deep Reverse