Mirroring other comments, this seems a bit trivial to be its own package and looking at the source, it seems to not cover cases where the local storage value can't be parsed.
https://usehooks.com/useLocalStorage/ has a safer implementation and is free to copy (Unlicense).