Function useRouteItem

Returns the current item based on the provided routes and history.

  • Type Parameters

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

      The type of the record for route parameters and data.

    • I extends ISwitchItem = ISwitchItem

      The type of the switch item.

    Parameters

    • routes: I[]

      An array of switch items representing the different routes.

    • history: MemoryHistory | BrowserHistory | HashHistory

      The history object used for navigation.

    Returns null | I

    • The current switch item based on the provided routes and history.