docs: improve examples and fix app wrapper (#1244)
This commit is contained in:
@@ -23,32 +23,3 @@ export default function App({ Component }: AppProps) {
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
There is also a possibility to modify the document template by using special
|
||||
tags `html`, `Head` or `body`. This can be done in any other Preact component,
|
||||
but using it in the application wrapper lets you define one common document
|
||||
template.
|
||||
|
||||
```tsx
|
||||
// routes/_app.tsx
|
||||
|
||||
import { asset, Head } from "$fresh/runtime.ts";
|
||||
import { AppProps } from "$fresh/src/server/types.ts";
|
||||
|
||||
export default function App({ Component }: AppProps) {
|
||||
return (
|
||||
<html data-custom="data">
|
||||
<Head>
|
||||
<title>Fresh</title>
|
||||
<link rel="stylesheet" href={asset("style.css")} />
|
||||
</Head>
|
||||
<body class="bodyClass">
|
||||
<Component />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Currently, there is no way of overriding default tags/attributes from provided
|
||||
template.
|
||||
|
||||
Reference in New Issue
Block a user