primereact
primereact copied to clipboard
UseStorage hook window listener does not parse JSON
When storing object in local storage using useStorate/useLocalStorage hook it parses/stringifies it fine when in current tab but when it is stored in another tab/window and gets refreshed it becomes string instead of object.
Traced it down to this line 26, I think it is missing JSON parse on the value: https://github.com/primefaces/primereact/blob/ad8dd1a7511f7e859cd926c1a300c1986ae44f03/components/lib/hooks/useStorage.js#L23-L29
thanks for the report please review my PR!