How to submit remix form or navigate from App Bridge v4 modal

I’m trying to make a simple delete confirmation using the App Bridge modal in a remix-based app (using the shopify template). The examples in the modal docs suggest this should be easy – but the examples just console.log on the button presses.

To actually make the delete happen, I need to submit a DELETE into one of my remix routes. I am able to do this, e.g. with fetch or even useSubmit from remix, but I’d like to trigger a navigation like a usual remix form so that the underlying app page will revalidate, or so that I can go to a different page.

Does anyone have an example of how to actually carry out mutations via the modal confirmation? This is supposed to be a “simple” case according to the Shopify modal examples, but it seems to not be. How does the app know I’m “confirming” the deletion?

It looks like remix navigate (from useNavigate) and submit (from useSubmit) do actually work as expected. I’m not sure what was going on in my initial tests where this didn’t seem to be the case – to be fair, sometimes the app bridge + site development environment is a bit buggy and things do randomly not work (clearing caches can help). Anyway, I can submit DELETE to my endpoint action and then redirect from there and the page navigates fine.

Glad this sorted itself out Ryan :slight_smile: