Closed liaoliao666 closed 2 years ago
If its possible to get the nearest context of QueryErrorResetBoundary
in the get
function of queryAtom
and it will be solved. but its not react hook, so that i can not think of any way to fix it.
Can anyone has some workaround to solve this problem
My initial question is if this is solvable with normal atoms without jotai/query. If we find a solution with normal atoms, then we will make/modify jotai/query to work in the same way. So, the goal is once we have atoms (either from jotai/query or not), we want to handle them consistently (especially for Suspense and ErrorBoundary).
Would anyone like to dig into it? How does useState
work?
I try to using QueryErrorResetBoundary of react query to reset this query. but unfortunately it does not work.
@liaoliao666 did you added the queryClient that you initialize for the react-query provider as the second parameter on your atomWithQuery
?
I have a issue that how can i reset the
queryAtom
, when query throw a error. I try to usingQueryErrorResetBoundary
of react query to reset this query. but unfortunately it does not work.