3 ms·
I have noticed that, in the wild, referencing window.localStorage at all will raise a security exception in some browsers. If this happens inside of a React hoo
by jbaudanza 7y ago
I have noticed that, in the wild, referencing window.localStorage at all will raise a security exception in some browsers. If this happens inside of a React hook, it will unmount everything up to the nearest componentDidCatch(). In practice, everything involving localStorage needs to make liberal use of try, catch blocks.
- andrew_ 7y agoSeconded. localStorage can bite in bad ways, and the unmounting concerns are valid.