I'm using a custom API to fetch data. I have an object that contains each data to be fetched, so everything is dynamic. At the point had to fetch data using the fetch() function. Now a request is been made when the component is mounted (componentDidMount). Since I'm using an object to fetch for each Json data, I'll have to map this object.
componentDidMount(){
CATEGORIES.map(function(category){
this.fetchApiData(category.key);
});
}
Now I have defined my fetchApiData() properly. It actually works without mapping but doesn't when I map the object.