method RouterLoadContext.get
RouterLoadContext.get<T>(key: RouterContextKey<T>): T

Reads a key, falling back to the key's defaultValue.

Type Parameters

Parameters

The context key

Return Type

The stored value, or the key's defaultValue

Throws

Error

When the key is unset and carries no defaultValue

Usage

import { type RouterLoadContext } from "react-router-plugin/src/index.ts";