-
Probably a simple question but I'm trying to find the right way to handle the following scenario: I have an app where a user can add items to a list - they do this through a global modal rendered in I'm struggling to get the data to revalidate after submitting using the modal -- the specific scenario is the user is on their Am I missing something in my set up that would cause this list to reload? Thanks! Edit: After looking through a few things, I'm stuck on the following: When I submit using the fetcher.Form to mylist.tsx: -- When I console log data[0], I'm seeing the loader re-running on the server and showing the latest list item. But the rendered MyList component's useLoaderData isn't updating its data.
mylist/add.ts
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For anyone that's stuck & finding this issue, I figured out what was happening -- I had a Make sure you let the fetcher's |
Beta Was this translation helpful? Give feedback.
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()
)! 😅