I have been struggling with determining how to best implement dialogs in React Router apps for years:
* useState to control their open state * Forms vs fetchers for data submissions * resource routes to form data(<select> options) * useEffect for listening for the action data to close the dialog * useEffect for listing for a toast message
There's a lot to consider. However, tons of these problems go away if you move dialogs into their own dedicated routes. This doesn't come without its own set of challenges though.