#Can't get the localstorage data back
5 messages · Page 1 of 1 (latest)
Use type guards
Or type assertions
It is possible, if nothing exists in localstorage that getitem returns nothing, and that is not valid JSON that can be parsed so you have to make sure that's it at least text
Use a type and cast your get item call as it.