Files
Jiachi LiuandGitHub fe6e74dc57 Fix missing _app component of AppTree in gIP context (#36206)
## Bug

The custom app is missing in the `ctx.AppTree` that causing the issue, it was accidently missed in custom _app.server pr #35666

Fixes #36198

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
2022-04-16 01:55:16 +00:00

18 lines
357 B
JavaScript

import { useContext } from 'react'
import { DummyContext } from './_app'
import { useRouter } from 'next/router'
const Page = () => {
const { pathname } = useRouter()
const ctx = useContext(DummyContext)
if (ctx == null) throw new Error('context consumes failed')
return (
<>
<h3>page: {pathname}</h3>
</>
)
}
export default Page