Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've tried to replace dependant queries with suspense one. I have
lazy
loaded component, I've added<Suspense />
component on top of my component. The problem now I have is that, in the dependant version of the queries, for the second query, theenabled
prop relies onstore
data available, before it fires theAPI
endpoint. Thestore
data is dispatched whenonSuccess
istrue
fromuseEffect
in the first query.In suspense version of the queries, the second query never waits the first query to finish,
useEffect
is changed a bit (asonSuccess
is missing) in the first query, to check if the data is available so candispatch
the data to thestore
, which never happens.First like query defined in the dependant version:
Replacing dependant queries like:
to suspense version like:
Beta Was this translation helpful? Give feedback.
All reactions