mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
`experimental.missingSuspenseWithCSRBailout` should be enabled by default to help users to disciver unwrapped suspense boundaries. Add more notes in the error doc about deprecation and temporary workaround to disable it. Closes NEXT-2157 --------- Co-authored-by: JJ Kasper <[email protected]>
37 lines
838 B
TypeScript
37 lines
838 B
TypeScript
'use client'
|
|
|
|
import { Suspense } from 'react'
|
|
import { useSearchParams } from 'next/navigation'
|
|
|
|
function InnerPage() {
|
|
const searchParams = useSearchParams()
|
|
return (
|
|
<>
|
|
<h1 id="pushstate-searchparams">PushState SearchParams</h1>
|
|
<pre id="my-data">{searchParams.get('query')}</pre>
|
|
<button
|
|
onClick={() => {
|
|
const url = new URL(window.location.href)
|
|
const previousQuery = url.searchParams.get('query')
|
|
url.searchParams.set(
|
|
'query',
|
|
previousQuery ? previousQuery + '-added' : 'foo'
|
|
)
|
|
window.history.pushState({}, '', url)
|
|
}}
|
|
id="push-searchparams"
|
|
>
|
|
Push searchParam
|
|
</button>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default function Page() {
|
|
return (
|
|
<Suspense>
|
|
<InnerPage />
|
|
</Suspense>
|
|
)
|
|
}
|