Table of Contents

Method UseRouteLoaderData

Namespace
Velvet
Assembly
Velvet.Docs.dll

UseRouteLoaderData<T>(string)

Returns the loader data of the route with the given Id (or RouteId) among the current location's matches, cast to T, from any component beneath the provider: React Router's useRouteLoaderData. Returns default when that route has no data or is not matched.

public static T? UseRouteLoaderData<T>(string routeId)

Parameters

routeId string

Returns

T

Type Parameters

T

Expected loader data type.

Exceptions

InvalidOperationException

No V.RouterProvider is mounted above the caller.