Skip to main content

Import

Usage

Return Type: useWalletNavigation

The hook returns an object with navigation controls and state:

Properties

setNavigation

(navigation: Navigation) => void Function to navigate to a new view. Automatically manages history:
  • If navigating to ‘home’, clears history
  • Otherwise, adds new location to history stack
  • Automatically scrolls to the top of the view

history

History Current navigation history stack containing the sequence of visited views.

setHistory

(history: History) => void Direct history manipulation function. It’s recommended to use setNavigation instead when possible because setNavigation:
  • Automatically scrolls to the top of the view
  • Handles special cases like clearing history when navigating to ‘home’
  • Ensures consistent history stack management
  • Provides a more maintainable and predictable navigation flow

goBack

() => void Function to navigate back to the previous view in history. When using setNavigation, you provide a Navigation object with:

Features

  • Automatic History Management: Maintains a stack of visited views
  • Home Navigation: Clears history when navigating to ‘home’
  • Automatic Scrolling: Scrolls to top of view on navigation
  • Back Navigation: Supports going back to previous views
  • Parameter Support: Pass data between views via navigation params

Examples

Basic Navigation

Using Back Navigation

Accessing History