Get data from an API and pass it as an argument to a function

React

CodeSandBox (code with two components): focused-buck-p4vh52 - CodeSandbox
As you can see in the image I want to take that ID data that I use in a component and use it as an argument in a function to get the data from another API, how would it be possible?

Other doubts:
Is it ok to put that second function inside useEffect()? I don’t think it would be very efficient but I need a way to load the second component (CardFilmDetail) with the second API (specific film) to render the data. I don’t know how to do the use Effect when it is in those paths ("/detail/" + film.episode_id).

Write the useEffect inside the CardFilm component and get id as props

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.