useHistory() subscribes to the stack history store.
TSX
It returns:
| Field | Meaning |
|---|---|
history | Read-only map of screen keys to history entries |
getRecent(n) | Most recent n entries, newest first |
getByNavigator(key) | Entries for one navigator, newest first |
getPath(fromKey, toKey) | Screen keys between two history entries |
get(key) | One history entry by screen key |
getMostRecent() | The latest history entry |