use-state-history
Move back/forward in state history
Source
Docs
PackageIcon
Usage
The useStateHistory hook creates a state with history. It returns the current value, handlers to
go back/forward, and a history object with all previous values and the current index.
Current value: 1
{
"history": [
1
],
"current": 0
}Definition
The UseStateHistoryHandlers and StateHistory interfaces are exported from the @mantine/hooks
package.
Exported types
The UseStateHistoryHandlers, UseStateHistoryReturnValue, and UseStateHistoryValue types are exported from @mantine/hooks;