Managing Application State
While a user is using an app, there is a high probability that the user will close the browser by mistake, move to another app, or even expect the app to be in the same flow after refreshing the page or opening the link in another tab.
Managing state is about keeping your app and the user experience consistent, bulletproof, and enjoyable. It’s about keeping track of what the user was doing, even if something unexpected happens.
This chapter teaches you about state management, and the various ways to store and transfer this state, either by using local storage, the URL, or in-memory solutions.
While learning about state management techniques, we will apply them directly to our BooksStore
project to preserve the state of the navigated page on the Index page. In addition, we will learn how to keep the state of the new book form, so that if the admin device faced an issue and the app closed suddenly, when the admin navigates to the form again...