Skip to content

bug: toggle disable not working as expected #2

@agustinusnathaniel

Description

@agustinusnathaniel

Reproduce link:

https://react-ts-c7hgfd.stackblitz.io
https://stackblitz.com/edit/react-ts-c7hgfd?file=ToggleTest.tsx

cause:

currently the disable callback in use-toggle hook are setting the state to true.

possible fix:

set disable callback in use-toggle to set state to false
https://github.com/kodingdotninja/use-toggle/blob/main/src/use-toggle.ts#L31

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions