mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This updates the Instant Navs DevTools panel to better model capture state across pending, SPA, and MPA navigations. - Revamps the Navigation Inspector UI states, controls, focus behavior, and panel transitions - Resets capture state when closing the panel from active capture states - Keeps MPA reloads and root-layout-crossing navigations from briefly showing stale or optimistic SPA state - Consolidates the panel state flow so cookie state, re-arming, and rendered UI status are easier to follow - Expands the instant navs fixture and tests to cover SPA captures, MPA captures, reloads, close/reset, Continue Rendering, and root-layout MPA links
27 lines
493 B
TypeScript
27 lines
493 B
TypeScript
'use client'
|
|
|
|
import { useEffect, useState } from 'react'
|
|
|
|
export function HydrationMarker() {
|
|
const [hydrated, setHydrated] = useState(false)
|
|
|
|
useEffect(() => {
|
|
setHydrated(true)
|
|
}, [])
|
|
|
|
return (
|
|
<span
|
|
data-testid="app-hydration-marker"
|
|
data-hydrated={hydrated ? 'true' : 'false'}
|
|
style={{
|
|
position: 'absolute',
|
|
width: 1,
|
|
height: 1,
|
|
overflow: 'hidden',
|
|
opacity: 0,
|
|
pointerEvents: 'none',
|
|
}}
|
|
/>
|
|
)
|
|
}
|