refetchOnWindowFocus with file picker #2793
-
I'm using a FileBrowser component populated with data from a useQuery. The component has an input type='file'. Once a file is selected, it calls back to a handler that I provide with a useMutation. This works fine if refetchOnWindowFocus is set to false, but the handler isn't called if refetchOnWindowFocus is true. I'm assuming, and evidence suggest, this is because the filePicker gets focus and returns it to the window once a file is selected, causing the query to fire and the component to redraw, which looses the in flight action in the shuffle. Here's how I'm using the mutation:
Is it wrong to destructure in this manner? Do I need to memoize something? Or somehow prevent the refetch? I'm a little unclear on this since my handler occurs after the file picker, so I would need to disable that outside of the context of the handler. Thanks in advance for any advice! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think my answer lies in the notifyOnChangeProps option. |
Beta Was this translation helpful? Give feedback.
I think my answer lies in the notifyOnChangeProps option.