Why localStorage Still Crashes Your Website in 2023
Too Long; Didn't Read
In autumn 2022, I decided to migrate one of our work projects from the Create React App to NextJs. The goal of this was to increase the performance of a few pages, separate pages for mobile devices from the main app, and decrease the number of 3rd parties with access. Most of our goals were achieved successfully but according to our Airbrake notifier, `localStorage` was always breaking something. The solution was quite simple, to put everything related to it into `useEffect` and `onChange` handlers.