adrianhajdin / project_mern_memories

This is a code repository for the corresponding video tutorial. Using React, Node.js, Express & MongoDB you'll learn how to build a Full Stack MERN Application - from start to finish. The App is called "Memories" and it is a simple social media app that allows users to post interesting events that happened in their lives.
https://youtube.com/playlist?list=PL6QREj8te1P7VSwhrMf3D3Xt4V6_SRkhu
4.95k stars 1.83k forks source link

Posts not displaying on the front end (circular progress by default) #157

Closed outterspacem closed 1 year ago

outterspacem commented 1 year ago

Hi all,

At the time of creation, I can see the posts displayed on the front end and they even get created in my MongoDB cluster. However when I inspect elements on my browser console, I don't see element get created and when I reload the page I get an infinite spinner (my guess is this is because it cannot retrieve any posts so applies the circular progress by default: !posts.length ? : (

Any ideas what the issue might be?

Thanks

Update: I solved the issue by making sure useEffect(() is under const dispatch = useDispatch(); in App.js