fix: PageProps.params never contains arrays, only strings (#91)

This commit is contained in:
Leo Kettmeir
2022-02-15 13:24:18 +01:00
committed by GitHub
parent 15f73e3274
commit 2ec980ca45
4 changed files with 40 additions and 15 deletions
+15
View File
@@ -0,0 +1,15 @@
/** @jsx h */
import { h, PageConfig, PageProps } from "../deps.ts";
export default function WildcardPage({ params }: PageProps) {
if (typeof params.path === "string") {
return <p>{params.path}</p>;
} else {
return <p>Not a string.</p>;
}
}
export const config: PageConfig = {
routeOverride: "/foo/:path*",
};