DEV Community

Discussion on: Fetching data from an api using React/Redux

Collapse
 
markusclaus profile image
Markus Claus • Edited

Thank you for the reply Alejandro.

You can import default exports with whatever name you want. I wanted to use fetchProducts in my code so I can't import it with this name because it would collide with the variable I use in a deeper scope.

To fix this I import everything that is a action with xxxAction and then use it without the Action suffix.

I hope this clarifies things.

Collapse
 
alegpereira profile image
Alejandro Pereira • Edited

You're right. I got confused. I'm learning react so i'm kind of new in those details and scanning the code properly.

Thanks!

Thread Thread
 
markusclaus profile image
Markus Claus

You are welcome mate. Good luck learning :)