docs: Remove references to deprecated types (#2125)
As per the [1.6 release](https://deno.com/blog/fresh-1.6#simplified-typings), and commentary by @csvn [here](https://github.com/denoland/fresh/issues/2108#issuecomment-1836625789), this PR aims to replace the references to deprecated typing in the documentation. Please see inline commentary for parts I'm unclear on.
This commit is contained in:
@@ -25,9 +25,9 @@ template which can be conditioned based on state and params. Note that any state
|
||||
set by middleware is available via `props.state`.
|
||||
|
||||
```tsx routes/sub/_layout.tsx
|
||||
import { LayoutProps } from "$fresh/server.ts";
|
||||
import { PageProps } from "$fresh/server.ts";
|
||||
|
||||
export default function Layout({ Component, state }: LayoutProps) {
|
||||
export default function Layout({ Component, state }: PageProps) {
|
||||
// do something with state here
|
||||
return (
|
||||
<div class="layout">
|
||||
@@ -43,9 +43,9 @@ In case you need to fetch data asynchronously before rendering the layout, you
|
||||
can use an async layout to do so.
|
||||
|
||||
```tsx routes/sub/_layout.tsx
|
||||
import { LayoutProps } from "$fresh/server.ts";
|
||||
import { FreshContext } from "$fresh/server.ts";
|
||||
|
||||
export default async function Layout(req: Request, ctx: LayoutContext) {
|
||||
export default async function Layout(req: Request, ctx: FreshContext) {
|
||||
// do something with state here
|
||||
const data = await loadData();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user