Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: useLocalStorage overload for correct undefined behavior
Fixes #2551 Instead of using a single function which accepts `defaultValue?: T` - which forces a return type of `T | undefined`, use an overload. When a defaultValue is supplied, the useState-like tuple returned uses `T`. When no defaultValue is supplied, it's `T | undefined`. Runtime usage is exaclty the same, this just improves the types.
- Loading branch information