fix(server): Improve MiddlewareHandler type for plugins (#1534)
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { Handlers, PageProps } from "../../../server.ts";
|
||||
import { HandlerContext, Handlers, PageProps } from "../../../server.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET(_req, ctx) {
|
||||
export const handler: Handlers<unknown, { test: string }> = {
|
||||
async GET(_req, ctx: HandlerContext<unknown, { test: string }>) {
|
||||
const resp = await ctx.render();
|
||||
return resp;
|
||||
},
|
||||
};
|
||||
|
||||
export default function Home(props: PageProps) {
|
||||
const value = props.state.test as string;
|
||||
export default function Home(props: PageProps<unknown, { test: string }>) {
|
||||
const value = props.state.test;
|
||||
return (
|
||||
<div>
|
||||
<h1>{value}</h1>
|
||||
|
||||
Reference in New Issue
Block a user