Toggle (between booleans or custom data)hook for React.
Arguments | Type | Description | Default value |
---|---|---|---|
initialValue | boolean | Initial value of the state | false |
toggleFunction | function | Function which determines how to toggle a value | v => !v |
Returned Array items | Type | Description |
---|---|---|
value | Any | Current value |
toggleValue | function | Toggle function which changes the value to the other value in the list of 2 acceptable values. (Mostly true or false) |
Join our discord server! You can click the floating discord icon at the bottom right of the screen and chat with us!