mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## Description I discovered a bug related to the coexistence of the app router and pages router in our application. When a page is being served by the pages router, any changes to server components (in this case, `globals.css` imported from `app/layout.tsx`) cause the entire page to reload, significantly lowering productivity. I believe this is not the intended behavior since server component changes should have no impact on pages served by the pages router. ## Investigation I traced the changes and found that: - At the point of this PR (https://github.com/vercel/next.js/pull/41464), the process seems to be handling this correctly. - Later, in this PR (https://github.com/vercel/next.js/pull/45268), it started causing reloads, seemingly intended for the app router but inadvertently affecting the pages router as well. Given that separate `hot-reloader-client.ts` files are now being used for the app router and pages router, it is now possible to correctly branch the hot-reloading process. I have tested this change locally and it is working fine.
11 lines
197 B
TypeScript
11 lines
197 B
TypeScript
import { ReactNode } from 'react'
|
|
import './styles.css'
|
|
|
|
export default function Root({ children }: { children: ReactNode }) {
|
|
return (
|
|
<html>
|
|
<body>{children}</body>
|
|
</html>
|
|
)
|
|
}
|