I have encountered a situation where I am able to pass the refetch function on a child component. However, an issue arises when transitioning to another page and implementing redux. This is particularly problematic when attempting to open a dialog for a new path link where I need to trigger the refetch function. Since redux cannot store a function like refetch, what would be the most effective solution in this scenario?
const { data: getWorkerGroupsResponse, refetch } = useQuery(
'get-worker-group',
async () => getWorkerGroups(projectId as string),
{
enabled: !!projectId,
},
);
In the code snippet above, there is a requirement to pass the refetch function to another page.