docs: make 2.x the default version (#3369)

This commit is contained in:
Marvin Hagemeister
2025-09-09 14:36:51 +02:00
committed by GitHub
parent 2c315a9972
commit 79d8cfc3ed
109 changed files with 1589 additions and 1502 deletions
+33
View File
@@ -0,0 +1,33 @@
---
description: |
Add a global app wrapper to provide common meta tags or context for application routes.
---
The app wrapper component is a Preact component that represents the outer
structure of the HTML document, typically up until the `<body>`-tag. It is only
rendered on the server and never on the client. The passed `Component` value
represents the children of this component.
```tsx main.tsx
function AppWrapper({ Component }) {
return (
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My App</title>
</head>
<body>
<Component />
</body>
</html>
);
}
app.appWrapper(AppWrapper);
```
Every [`ctx.render()`](/docs/concepts/context#render-1) call will include the
app wrapper component by default, unless opted out.
Note that only one app wrapper component is supported per
[`App`](/docs/concepts/app) instance.