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() {
61
61
62
62
// 🐨 change this to setContentKey(historyKey)
63
63
startTransition ( ( ) => setContentPromise ( nextContentPromise ) )
64
+ // 🐨 otherwise, setContentKey(historyKey) directly (no transition needed)
64
65
}
65
66
window . addEventListener ( 'popstate' , handlePopState )
66
67
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
Original file line number Diff line number Diff line change @@ -56,9 +56,10 @@ function Root() {
56
56
const fetchPromise = fetchContent ( nextLocation )
57
57
const nextContentPromise = createFromFetch ( fetchPromise )
58
58
contentCache . set ( historyKey , nextContentPromise )
59
+ startTransition ( ( ) => setContentKey ( historyKey ) )
60
+ } else {
61
+ setContentKey ( historyKey )
59
62
}
60
-
61
- startTransition ( ( ) => setContentKey ( historyKey ) )
62
63
}
63
64
window . addEventListener ( 'popstate' , handlePopState )
64
65
return ( ) => window . removeEventListener ( 'popstate' , handlePopState )
You can’t perform that action at this time.
0 commit comments