DEV Community

Discussion on: the correct way to fetch data with react hooks

Collapse
 
nicomartin profile image
Nico Martin

Hi @shatvani
Where do you call useApi? Inside a Functional Component?

Collapse
 
shatvani profile image
shatvani

Hi,
Yes, from another functional component.
But now I have started a course in Udemy, because it is a hard stuff just to jim in it.
Thank you.

Thread Thread
 
nicomartin profile image
Nico Martin

Yes, that makes sense. I guess React does not see "datasource" as a component and therefore you can't use a hook inside of it. But if you lear it bottom up with udemy thats definately a great idea!
Have fun!