Type safe context in Remix 2.0

I'm working a Remix 2.0 website deployed to Pages. I'm using KV but the context in the action and loader functions don't know about it. I'd rather not copy/paste
interface Env {
CONTENT: KVNamespace;
}
...
let env = context.env as Env;
interface Env {
CONTENT: KVNamespace;
}
...
let env = context.env as Env;
into every page. I've found posts like (https://tom-sherman.com/blog/type-safe-remix-cloudflare-loader-context) but those are from 1.x times and the server files seem different. Has anyone done this?
0 Replies
No replies yetBe the first to reply to this messageJoin