How to make Route.LoaderArgs
context
type safe?
#12859
-
Following the type safety article
How do I set the type to be used for the
|
Beta Was this translation helpful? Give feedback.
Answered by
sergiodxa
Jan 25, 2025
Replies: 1 comment 3 replies
-
The context object is typed with the interface AppLoadContext, you can overwrite it using declaration merging, in a import "react-router";
declare module "react-router" {
interface AppLoadContext {
// add things here
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
davidbielik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The context object is typed with the interface AppLoadContext, you can overwrite it using declaration merging, in a
.ts
or.d.ts
file do