skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search