Table of Contents

Method UseNavigate

Namespace
Velvet
Assembly
Velvet.Docs.dll

UseNavigate()

Returns React Router's navigate: navigate(to, options) pushes (or, with Replace, replaces) the target path, and navigate(delta) moves along the history stack. The target may be absolute (/foo) or relative (., .., ../sibling). Relative targets resolve from the calling component's enclosing Outlet route level. Without one, the router uses the current leaf route level when matches exist; otherwise it uses the current URL path, or the root before the first location. Relative set to Path drops URL segments of that route's pathname instead of whole routes. Navigation is driven by the router V.RouterProvider publishes above the caller.

public static NavigateFunction UseNavigate()

Returns

NavigateFunction

A stable delegate; the returned VelvetTask<T> can be awaited or fire-and-forget.

Exceptions

InvalidOperationException

No V.RouterProvider is mounted above the caller.