use-state-history
Move back/forward in state history
Import
Source
Docs
Package
Usage
useStateHistory
hook is used to create a state with history, it returns current value, handlers to
go back/forward and a history object with all previous values and current index.
Current value: 1
{ "history": [ 1 ], "current": 0 }
Definition
UseStateHistoryHandlers
and StateHistory
interfaces are exported from @mantine/hooks
package.