Relative Content

Tag Archive for reactjstypescriptapireact-hookshook

Studying React, TypeScript. My solution renders different numbers of hooks and creates an error

I have 2 APIs. To get data from the first one I use data from the second one as an input. And the data from the second one is a list that can contain 1 or 2 elements. I do understand why I have the problem (because the result can be 1 or 2 then it will render 1 or 2 times) but I do not know how to approach it. I’d appreciate ideas on where to look or what to read about it. I still need to show both results, if the 2nd API returns 2 results.