mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
When PPR was enabled, the "restore" action in PPR was causing the `loading` boundary for the visible `CacheNode` to lose it's `loading`. This caused the `Suspense` boundary that contained the loading information to disappear, which in turn caused the tree to remount since it wraps all the page children. I can't think of a reason why we'd not want to preserve the existing `loading` data here, as it's not tied to the prefetch. closes #68484 --------- Co-authored-by: Hendrik Liebau <[email protected]>
23 lines
382 B
TypeScript
23 lines
382 B
TypeScript
'use client'
|
|
|
|
import * as React from 'react'
|
|
|
|
export function Input() {
|
|
const [query, setQuery] = React.useState('')
|
|
|
|
React.useEffect(() => {
|
|
if (!query) {
|
|
return
|
|
}
|
|
|
|
window.history.replaceState({ query }, null, `?q=${query}`)
|
|
}, [query])
|
|
|
|
return (
|
|
<input
|
|
onChange={(event) => setQuery(event.currentTarget.value)}
|
|
value={query}
|
|
/>
|
|
)
|
|
}
|