OptionaldefaultValue: TAn optional default value for the context. This value will be returned if no value has been set for this context.
A RouterContext object that can be used with
context.get() and context.set() in actions,
loaders, and middleware.
Creates a type-safe RouterContext object that can be used to store and retrieve arbitrary values in
actions,loaders, and middleware. Similar to React'screateContext, but specifically designed for React Router's request/response lifecycle.If a
defaultValueis provided, it will be returned fromcontext.get()when no value has been set for the context. Otherwise, reading this context when no value has been set will throw an error.