but i don't see fetchProductsAction in fetchProducts.js. I see only fetchProducts. Is this a typo or some code is missing?. I believe is only a mistake but just want to confirm.
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.
Nice post. One question. You do this:
but i don't see fetchProductsAction in fetchProducts.js. I see only fetchProducts. Is this a typo or some code is missing?. I believe is only a mistake but just want to confirm.
Thanks.
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.
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!
You are welcome mate. Good luck learning :)