1
0
Fork 0

fix(shared): Render loop in useLocalStorage hook

I've emptied the useEffect array here, I'm sure the linter won't agree
but at least it fixes a render loop that was nasty.
This commit is contained in:
joostdecock 2023-03-12 17:59:43 +01:00
parent ee477ff3b2
commit 0dbf76c9bf

View file

@ -32,7 +32,7 @@ export function useLocalStorage(key, initialValue) {
} catch (error) {
console.log(error)
}
}, [setReady, setValue, key, initialValue])
}, []) // The linter will hate this, but this was cleared to stop a render loop
return [storedValue, setValue, ready]
}