feat: allow passing additional args to HandlerContext.render (#82)

Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
This commit is contained in:
Leo Kettmeir
2022-02-11 01:25:47 +01:00
committed by GitHub
co-authored by Luca Casonato
parent 6abf62c832
commit 788a85c431
7 changed files with 75 additions and 18 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
export interface PageProps {
export interface PageProps<T extends Record<string, unknown>> {
/** The URL of the request that resulted in this page being rendered. */
url: URL;
@@ -15,6 +15,12 @@ export interface PageProps {
* be `{ path: [ 'bar', 'baz' ] }`.
*/
params: Record<string, string | string[]>;
/**
* Additional data passed into `HandlerContext.render`. Not present by
* default.
*/
renderData?: T;
}
export interface PageConfig {