I have successfully deployed my react app without errors on netlify but it crashes when I refresh it.
Full code for the react app is given in the below repository:
https://github.com/heni2021/Social-Media-Frontend
Deployed Url : http://i-chatter.netlify.app
Pls if anyone can help how to resolve this refresh issue.
This issue comes when u successfully login and then refresh it.
My thoughts till now: I am using local storage to store authentication token which gets flushed when page refreshes. If i am correct in thinking this then can you give me possible solutions?
2
Answers
I don’t think it’s token issue. It’s more to route issue somewhere in your web server configuration. For i.e. nginx, apache, etc, depends on the web server you are using.
In this example, whenever you want to refresh the items, you can call the fetchItems() function. This will get the updated list of items and update the state, causing a re-render of the ItemList component with the new data.