Skip to content

Revalidate current route after global modal submits with fetcher.Form #5429

Closed Answered by mediadiet
mediadiet asked this question in Q&A
Discussion options

You must be logged in to vote

For anyone that's stuck & finding this issue, I figured out what was happening -- I had a useEffect that was unmounting the modal as soon as the action the fetcher.Form was submitting to returned {success: true}.

Make sure you let the fetcher's actionReload run before closing or unmounting the modal (if (fetcher.type === 'done' && fetcher.data.success) closeModal())! 😅

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mediadiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant