interface RouterContextKey
Since 0.2.0

A React Router context key, used by identity as the argument to RouterLoadContext.get / RouterLoadContext.set.

Structurally identical to React Router's RouterContext<T>, so a key created by this package and a key created by createContext<T>() from react-router are interchangeable. defaultValue is returned by get() when no value has been set; a key without one makes get() throw for an unset key.

Type Parameters

Properties

readonly
optional
defaultValue: T

Value returned by get() when the key has not been set.

Usage

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