recently, I am learning the framework of react. I have only used a single-page application before, but now I want to use it to build a multi-page forum application. If I encounter some questions, I will ask my predecessors to answer them.
I now get the data from the server and initiate an action to change the store and re-render the page.
ask three main questions first:
1. Many pages have shared data information, such as the simple display of user information in the forum header. How should this information be put into store so that operations such as refreshing and redirecting pages will not reset store?
because the store is reset because the page is refreshed or a new page is opened, I designed the login page to store the data in store, and the page to jump (window.location.href jump) to the forum home page, and then found that store has been reset, which is equivalent to doing nothing.
should the shared data be saved in loaclstorage first, and then put into store after any operation that will cause the page refresh effect is completed?
2. Because I want to make it multi-page, I use a tag instead of Link tag in many places. Is that wrong?
3. In multi-page mode, is the store of different pages the same? How to design store? for multi-page applications