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:
@@ -14,9 +14,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/_app.tsx
|
||||
import { AppProps } from "$fresh/server.ts";
|
||||
import { PageProps } from "$fresh/server.ts";
|
||||
|
||||
export default function App({ Component, state }: AppProps) {
|
||||
export default function App({ Component, state }: PageProps) {
|
||||
// do something with state here
|
||||
return (
|
||||
<html>
|
||||
@@ -37,12 +37,12 @@ export default function App({ Component, state }: AppProps) {
|
||||
|
||||
Similar to routes and layouts, the app wrapper can be made asynchronous. This
|
||||
changes the function signature so that the first argument is the `Request`
|
||||
instance and the second one is the `AppContext`.
|
||||
instance and the second one is the `FreshContext`.
|
||||
|
||||
```tsx routes/_app.tsx
|
||||
import { AppContext } from "$fresh/server.ts";
|
||||
import { FreshContext } from "$fresh/server.ts";
|
||||
|
||||
export default async function App(req: Request, ctx: AppContext) {
|
||||
export default async function App(req: Request, ctx: FreshContext) {
|
||||
const data = await loadData();
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user