mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## 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`
18 lines
357 B
JavaScript
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
|