Skip to content

Commit 5064961

Browse files
authored
make getLoadContext Context generic (#71)
1 parent a61e01e commit 5064961

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/cloudflare/d1-drizzle/app/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ type Bindings = {
88
db: DrizzleD1Database<typeof schema>;
99
};
1010

11-
const app = new Hono<{ Bindings: Bindings }>();
11+
const app = new Hono<{ Bindings: Bindings; Variables: Env }>();
1212

1313
export default await createHonoServer({
1414
app,
1515
getLoadContext(c) {
16-
const db = drizzle(c.env.DB, { schema });
16+
const db = drizzle(c.var.DB, { schema });
1717
return { db };
1818
},
1919
});

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-hono-server",
3-
"version": "2.8.1",
3+
"version": "2.8.2",
44
"type": "module",
55
"description": "The Vite plugin you need to create a Hono server for your React Router app in less than 10 seconds.",
66
"exports": {

src/types/hono-server-options-base.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface HonoServerOptionsBase<E extends Env> {
3939
* ```
4040
*/
4141
getLoadContext?: (
42-
c: Context,
42+
c: Context<E>,
4343
options: {
4444
build: ServerBuild;
4545
mode: string;

0 commit comments

Comments
 (0)