Skip to content

Support for optional defaultValue. #8

Description

@PauloMFJ

Clearly describe the bug

useLocalState doesn't support optional defaultValue.

Which version of use-local-state are you using?

0.1.0

What version of React are you using use-local-state within?

16.8.0

What build/platform are you using?

New package tests.

What did you expect to happen?

Ability to define just a key without enforcing a defaultValue, ie: setLocalState<string | undefined>("KEY").

What actually happened (e.g. what warnings or errors did you get)?

Typescript errors as defaultValue is required.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions