My initial thought is to use a form to navigate to an action on a route. If it is just a Form navigation to an action, you can set up a route that is specifically designed to handle only that action. You can use it on the same route as your delete route if you prefer. And check that the action is a delete. Then use your useActionData hook, I believe it's called, to trigger your toast action. This should trigger a re-render on the route's loader populating with the updated information. Again, this is just an initial thought. There may be a better way, but that's how I'd go about getting it to work, then cleaning up where I can.
#Refatch data
6 messages · Page 1 of 1 (latest)
This is exactly how it should be done using react-router imo. 👍
I am trying but I cant figure it out
I used navigate("/"); and it worked
How does your action look like?
Did not used action I used navigate in the try block