Skip to main content

use_view_path

Returns the resolved URL for the current view level.

This differs from use_route_location which returns the full current URL. use_view_path returns the URL up to the current view level (the leaf route of the view in manage_views=True mode).

Useful as the route value for View to produce a unique Navigator key per view in the stack.

Must be called inside a component rendered by a Router. Returns an empty string if called outside a Router tree.

Returns:

  • str - The resolved URL for this view level (e.g. "/products/42").