If there is a theme item in localStorage with an invalid value like "light" (e.g. when the user did run another project on localhost before that used the same key), the whole app crashes. On smaller screen sizes it's even worse, the mobile menu does not disappear and the user will never see any content.
Parsing errors should be catched and the stored ignored.
If there is a
theme
item in localStorage with an invalid value like "light" (e.g. when the user did run another project on localhost before that used the same key), the whole app crashes. On smaller screen sizes it's even worse, the mobile menu does not disappear and the user will never see any content.Parsing errors should be catched and the stored ignored.