Dynamic instances of useLazyQuery hooks

How could we instanciate a useLazyQuery hook which depends on previous useLazyQuery data response.
Once we get the data, we need to decide which useLazyQuery hook we should be using.
I already tried skip query aproach, but doesn’t work for my use case.
Other aproaches involve calling hooks conditionally, which is not allowed in React.


1 Like

Could you just use smaller components for those, and render them conditionally?

Thank you Kevin. I did try that as well, but unfortunately couldn’t make them work as expected. It could be great if I could show you somehow, the code and explained better, because my english is not that good, at least the writting.

Thanks again

1 Like