You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We added custom _app as server component support in #33149, but we found it's pretty confusing on usage like support it both server component pages and regular pages at the same time for having similar layout purpose.
When using the _app.server and _app at the same time, applying them into proper places become more confusing.
In that case, we decide to make _app.js can't be a server component, and you can still keep all the existing thing there. And also you don't need to think of the corresponding APIs of custom _app in RSC
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Docs updated
Copy file name to clipboardExpand all lines: docs/advanced-features/react-18/server-components.md
+1-9
Original file line number
Diff line number
Diff line change
@@ -94,15 +94,7 @@ export default function Document() {
94
94
95
95
### `next/app`
96
96
97
-
If you're using `_app.js`, the usage is the same as [Custom App](/docs/advanced-features/custom-app).
98
-
If you're using `_app.server.js` as a server component, see the example below where it only receives the `children` prop as React elements. You can wrap any other client or server components around `children` to customize the layout of your app.
99
-
100
-
```js
101
-
// pages/_app.server.js
102
-
exportdefaultfunctionApp({ children }) {
103
-
return children
104
-
}
105
-
```
97
+
The usage of `_app.js` is the same as [Custom App](/docs/advanced-features/custom-app). Using custom app as server component such as `_app.server.js` is not recommended, to keep align with non server components apps for client specific things like global CSS imports.
0 commit comments