Skip to content

Commit 0d0a137

Browse files
docs: fix some issues (#294)
Co-authored-by: Luca Casonato <hello@lcas.dev>
1 parent 989e177 commit 0d0a137

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

docs/concepts/error-pages.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ description: |
33
Error pages can be used to customize the page that is shown when an error occurs in the application.
44
---
55

6-
Fresh supports customizing the 404 Not Found, and the 500 Internal Server Error
7-
pages. These are shown when a request is made but no matching route exists, and
8-
when a middelware, route handler, or page component throws an error
9-
respectively.
6+
Fresh supports customizing the `404 Not Found`, and the
7+
`500 Internal Server Error` pages. These are shown when a request is made but no
8+
matching route exists, and when a middelware, route handler, or page component
9+
throws an error respectively.
1010

1111
The 404 page can be customized by creating a `_404.tsx` file in the `routes/`
1212
folder. The file must have a default export that is a regular Preact component.

docs/concepts/islands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function MyIsland() {
3030
}
3131
```
3232

33-
An island can be used in a page like a regular preact component. Fresh will take
33+
An island can be used in a page like a regular Preact component. Fresh will take
3434
care of automatically re-hydrating the island on the client.
3535

3636
Passing props to islands is supported, but only if the props are JSON

docs/concepts/routes.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The handler is a function that is called for every request to the route. It
1212
needs to return a response that is then sent to the client. The response could
1313
be anything: a plain text string, a JSON object, an HTML page, a WebSocket
1414
connection, a streaming file, or pretty much anything else. The handler is
15-
passed a `render` function that it can call to invoke rendering the component.
15+
passed a `render` function that it can call to invoke rendering a component.
1616

1717
The component is the template for a page. It is a JSX element that is rendered
1818
on the server. The page component gets passed props that can be used by it to
19-
determine exactly what should be rendered. By default the request URL, the
20-
matches from the URL pattern match, and any data passed to the handler's
21-
`render` function are passed to the component as props.
19+
determine exactly what should be rendered. By default components receives props
20+
consisting of: the request URL, the matches from the URL pattern match, and any
21+
data passed to the handler's `render` function.
2222

2323
Let's look at a basic route that returns a plain text string:
2424

@@ -38,9 +38,10 @@ To define a handler, one needs to export a `handler` function or object from the
3838
route module. If the handler is an object, each key in the object is the name of
3939
the HTTP method that the handler should be called for. For example the `GET`
4040
handler above is called for `GET` requests. If the handler is a function, it is
41-
called for all requests regardless of the method.
41+
called for all requests regardless of the method. If a HTTP method does not have
42+
a corresponding handler, a 405 HTTP error is returned.
4243

43-
Now, let's render some HTML using the route component. Another example:
44+
Now, let's render some HTML using the route component:
4445

4546
```tsx
4647
// routes/html.tsx

docs/concepts/static-files.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
> TODO(lucacasonato): this page still needs to be completed
2-
31
Fresh automatically serves static assets placed in a `static/` directory in the
42
project root. These assets are served at the root of the webserver, with a
53
higher priority than routes. This means that if a given request matches a file

0 commit comments

Comments
 (0)