#How to handle a form submit result with fetcher?
1 messages · Page 1 of 1 (latest)
Bumping this one again, I feel like useEffect is not the right approach for this?
we are redirecting with searchparams on the same route for example like toast?=success
Yes, fetcher.data and fetcher.state together should work well to give you the info you need for showing toast notification.
Yeah, I've run into this before as well. I've only managed to get it working via useEffect which feels pretty fragile and wrong. I wish the submit function actually returned a promise that resolved once the action was complete.
true
Maybe this could help: