File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ function Root() {
6161
6262 // 🐨 change this to setContentKey(historyKey)
6363 startTransition ( ( ) => setContentPromise ( nextContentPromise ) )
64+ // 🐨 otherwise, setContentKey(historyKey) directly (no transition needed)
6465 }
6566 window . addEventListener ( 'popstate' , handlePopState )
6667 return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -56,9 +56,10 @@ function Root() {
5656 const fetchPromise = fetchContent ( nextLocation )
5757 const nextContentPromise = createFromFetch ( fetchPromise )
5858 contentCache . set ( historyKey , nextContentPromise )
59+ startTransition ( ( ) => setContentKey ( historyKey ) )
60+ } else {
61+ setContentKey ( historyKey )
5962 }
60-
61- startTransition ( ( ) => setContentKey ( historyKey ) )
6263 }
6364 window . addEventListener ( 'popstate' , handlePopState )
6465 return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
You can’t perform that action at this time.
0 commit comments