docs: remove JSX pragma everywhere

This commit is contained in:
Luca Casonato
2022-09-08 11:53:38 +02:00
committed by Luca Casonato
parent 6c4f3a36d0
commit 77142fe4a0
10 changed files with 0 additions and 33 deletions
@@ -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() {
-7
View File
@@ -37,9 +37,6 @@ This is done with JSX.
```tsx
// routes/about.tsx
/** @jsx h */
import { h } from "preact";
export default function AboutPage() {
return (
<main>
@@ -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`.
<!-- You can find more in depth information about routes on the
-2
View File
@@ -30,8 +30,6 @@ then adds a custom header to the response before returning it:
```tsx
// routes/about.tsx
/** @jsx h */
import { h } from "preact";
import { Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
-2
View File
@@ -27,8 +27,6 @@ as arguments in its `props` object though.
```tsx
// routes/greet/[name].tsx
/** @jsx h */
import { h } from "preact";
import { PageProps } from "$fresh/server.ts";
export default function GreetPage(props: PageProps) {
-2
View File
@@ -23,8 +23,6 @@ renders it in a page component.
```tsx
// routes/github/[username].tsx
/** @jsx h */
import { h } from "preact";
import { Handlers, PageProps } from "$fresh/server.ts";
interface User {
-2
View File
@@ -32,8 +32,6 @@ server side:
```tsx
// routes/search.tsx
/** @jsx h */
import { h } from "preact";
import { Handlers, PageProps } from "$fresh/server.ts";
const NAMES = ["Alice", "Bob", "Charlie", "Dave", "Eve", "Frank"];