@@ -25,7 +25,9 @@ export default function SuspenseBreadcrumbs(): React$Node {
2525 const store = useContext ( StoreContext ) ;
2626 const treeDispatch = useContext ( TreeDispatcherContext ) ;
2727 const suspenseTreeDispatch = useContext ( SuspenseTreeDispatcherContext ) ;
28- const { selectedSuspenseID, lineage} = useContext ( SuspenseTreeStateContext ) ;
28+ const { selectedSuspenseID, selectedRootID, lineage} = useContext (
29+ SuspenseTreeStateContext ,
30+ ) ;
2931
3032 const { highlightHostInstance, clearHighlightHostInstance} =
3133 useHighlightHostInstance ( ) ;
@@ -43,9 +45,20 @@ export default function SuspenseBreadcrumbs(): React$Node {
4345 // that rendered the whole screen. In laymans terms this is really "Initial Paint".
4446 // TODO: Once we add subtree selection, then the equivalent should be called
4547 // "Transition" since in that case it's really about a Transition within the page.
46- < li className = { styles . SuspenseBreadcrumbsListItem } >
47- < span className = { styles . SuspenseBreadcrumbsText } > Initial Paint</ span >
48- </ li >
48+ selectedRootID !== null ? (
49+ < li
50+ className = { styles . SuspenseBreadcrumbsListItem }
51+ aria-current = { selectedSuspenseID === selectedRootID }
52+ onPointerEnter = { highlightHostInstance . bind ( null , selectedRootID ) }
53+ onPointerLeave = { clearHighlightHostInstance } >
54+ < button
55+ className = { styles . SuspenseBreadcrumbsButton }
56+ onClick = { handleClick . bind ( null , selectedRootID ) }
57+ type = "button" >
58+ Initial Paint
59+ </ button >
60+ </ li >
61+ ) : null
4962 ) : (
5063 lineage . map ( ( id , index ) => {
5164 const node = store . getSuspenseByID ( id ) ;
0 commit comments