File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,10 +259,11 @@ export function InterlinearNavProvider({
259259
260260 const navigate = useCallback (
261261 ( newScrRef : SerializedVerseRef , origin : NavOrigin = 'external' ) => {
262- // Invariant: a marker write is ALWAYS paired with the `setScrRef` below. The `liveScrRef` memo
263- // reads this marker but lists only `[rawScrRef]` as a dependency, relying on every marker write
264- // also pushing a new ref through the host (which re-runs the memo). Never set a marker here
265- // without the accompanying `setScrRef`, or the memo could read a stale marker.
262+ // Invariant: a marker write is ALWAYS paired with the `setScrRef` below. The marker readers
263+ // that run during render — the render-phase mid-reveal guard, which lists only `[rawScrRef]`
264+ // in the reactive path that reaches it — rely on every marker write also pushing a new ref
265+ // through the host, so the render that reads the marker is the one that sees it fresh. Never
266+ // set a marker here without the accompanying `setScrRef`, or a reader could see a stale marker.
266267 if ( origin === 'internal' ) pendingInternalNavRef . current . set ( verseKey ( newScrRef ) , Date . now ( ) ) ;
267268 setScrRef ( newScrRef ) ;
268269 } ,
You can’t perform that action at this time.
0 commit comments