invalidateQueries does not work as expected
I have three different use cases of invalidateQueries, add user, ban/unban user and delete user, when I perform one of those actions it does not trigger a re-render, until I use removeQueries + refetchQueries for it to work
3 Replies
national-gold•2w ago
it will only trigger a re-render if the data returned by the refetch is different than what's already on screen. If you call invalidateQueries() and see a network request going out, it's working fine.
passive-yellowOP•2w ago
the issue is with my react-table implementation, I had to use useEffect to set the data after the refetch happens, as you pointed: it did a network request, but now handleDragEnd does not work
national-gold•2w ago
not sure what you're trying to achieve here but useEffects like this are usually an anti-pattern that you'd want to avoid.