I build a project in React using Redux and Router and I have a little question. If I navigate between project pages by clicking buttons, my state from Redux is not deleted.
But if I try to write the url instead of clicking the button to go to the same page, my state is deleted.
How can I resolve this problem?
Your redux store gets deleted because you have refreshed the page and no data related to the main page is present in the redux now , If you want to retain data inside redux even when you type url in browser without clicking any button , just use localstorage along with redux , and apply a check if your localstorage is present then store all the data inside redux else store data from redux to local storage .
I hope this solves your issue .