diff --git a/docs/concepts/error-pages.md b/docs/concepts/error-pages.md index b144ab81..d1a4d078 100644 --- a/docs/concepts/error-pages.md +++ b/docs/concepts/error-pages.md @@ -15,8 +15,6 @@ folder. The file must have a default export that is a regular Preact component. A props object of type `UnknownPageProps` is passed in as an argument. ```tsx -/** @jsx h */ -import { h } from "preact"; import { UnknownPageProps } from "$fresh/server.ts"; export default function NotFoundPage({ url }: UnknownPageProps) { @@ -32,8 +30,6 @@ example when the route did match, but the requested resource does not exist. This can be achieved with `ctx.renderNotFound`. ```tsx -/** @jsx h */ -import { h } from "preact"; import { Handlers, PageProps } from "$fresh/server.ts"; export const handler: Handlers = { @@ -63,8 +59,6 @@ folder. The file must have a default export that is a regular Preact component. A props object of type `ErrorPageProps` is passed in as an argument. ```tsx -/** @jsx h */ -import { h } from "preact"; import { ErrorPageProps } from "$fresh/server.ts"; export default function Error500Page({ error }: ErrorPageProps) { diff --git a/docs/concepts/islands.md b/docs/concepts/islands.md index 4d9fe2e7..5e30d135 100644 --- a/docs/concepts/islands.md +++ b/docs/concepts/islands.md @@ -14,8 +14,6 @@ island. The file must have a default export that is a regular Preact component. ```tsx // islands/MyIsland.tsx -/** @jsx h */ -import { h } from "preact"; import { useState } from "preact/hooks"; export default function MyIsland() { diff --git a/docs/concepts/routes.md b/docs/concepts/routes.md index c4c2de7c..08c9a97b 100644 --- a/docs/concepts/routes.md +++ b/docs/concepts/routes.md @@ -50,8 +50,6 @@ Now, let's render some HTML using the route component: ```tsx // routes/html.tsx -/** @jsx h */ -import { h } from "preact"; import { PageProps } from "$fresh/server.ts"; export default function Page(props: PageProps) { @@ -75,8 +73,6 @@ response after rendering the page component. ```tsx // routes/html.tsx -/** @jsx h */ -import { h } from "preact"; import { HandlerContext, Handlers, PageProps } from "$fresh/server.ts"; export const handler: Handlers = { diff --git a/docs/concepts/static-files.md b/docs/concepts/static-files.md index fe6463db..8dd06770 100644 --- a/docs/concepts/static-files.md +++ b/docs/concepts/static-files.md @@ -30,8 +30,6 @@ is requested at this "locked" path, it will be served with a cache lifetime of one year. ```jsx -/** @jsx h */ -import { h } from "preact"; import { asset } from "$fresh/runtime.ts"; export default function Page() { diff --git a/docs/getting-started/adding-interactivity.md b/docs/getting-started/adding-interactivity.md index 7e939086..981e1c7e 100644 --- a/docs/getting-started/adding-interactivity.md +++ b/docs/getting-started/adding-interactivity.md @@ -31,8 +31,6 @@ Here is an example of an island component that counts down to a specific time. ```tsx // islands/Countdown.tsx -/** @jsx h */ -import { h } from "preact"; import { useEffect, useState } from "preact/hooks"; const timeFmt = new Intl.RelativeTimeFormat("en-US"); @@ -76,8 +74,6 @@ client with the correct props: ```tsx // routes/countdown.tsx -/** @jsx h */ -import { h } from "preact"; import Countdown from "../islands/Countdown.tsx"; export default function Page() { diff --git a/docs/getting-started/create-a-route.md b/docs/getting-started/create-a-route.md index dd15e07a..4518dbe3 100644 --- a/docs/getting-started/create-a-route.md +++ b/docs/getting-started/create-a-route.md @@ -37,9 +37,6 @@ This is done with JSX. ```tsx // routes/about.tsx -/** @jsx h */ -import { h } from "preact"; - export default function AboutPage() { return (
@@ -50,10 +47,6 @@ export default function AboutPage() { } ``` -> ℹ️ The first two lines are the JSX pragma, and the import for the JSX create -> element function. These are just boilerplate. You don't need to know exactly -> what they do - they just ensure that JSX gets rendered correctly. - The new page will be visible at `http://localhost:8000/about`.