feat: support async layout functions (#1597)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
co-authored by
Asher Gomez
parent
11077227b5
commit
8325225a0d
@@ -0,0 +1,15 @@
|
||||
import { LayoutProps, RouteContext } from "$fresh/server.ts";
|
||||
|
||||
export default async function AsyncLayout(
|
||||
req: Request,
|
||||
ctx: RouteContext,
|
||||
{ Component }: LayoutProps,
|
||||
) {
|
||||
await new Promise((r) => setTimeout(r, 10));
|
||||
return (
|
||||
<div class="async-layout">
|
||||
<p>Async layout</p>
|
||||
<Component />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user