Function useRouteParams

The useRouteParams hook is used to retrieve the parameters of the currently active route.

  • Type Parameters

    • T extends Record<string, any> = Record<string, any>

      The type of the route parameters.

    • I extends ISwitchItem = ISwitchItem

      The type of the switch items.

    Parameters

    • routes: I[]

      Array of route items.

    • history: MemoryHistory | BrowserHistory | HashHistory

      The history object to track route changes.

    Returns null | T

    • The parameters of the currently active route.