@@ -17,16 +17,16 @@ const SceneRSCView = ({active, name, refetch: serverRefetch, errorFallback, chil
17
17
const { state, oldState, data, stateNavigator : { stateContext, historyManager} } = navigationEvent ;
18
18
const { crumbs, nextCrumb : { crumblessUrl : url } , oldUrl, oldData, history, historyAction} = stateContext ;
19
19
const { deserialize} = useContext ( BundlerContext ) ;
20
- const { fetching : ancestor } = useContext ( RSCContext ) ;
20
+ const rscContext = useContext ( RSCContext ) ;
21
21
const sceneViewKey = name || ( typeof active === 'string' ? active : active [ 0 ] ) ;
22
22
const getShow = ( stateKey : string ) => (
23
23
active != null && state && (
24
24
typeof active === 'string' ? stateKey === active : active . indexOf ( stateKey ) !== - 1
25
25
)
26
26
) ;
27
27
const show = getShow ( state . key ) ;
28
- const ignore = ! ! navigationEvent [ 'ignoreCache' ] ;
29
- const [ { ancestorFetching, ignoreCache} , refetcher ] = useOptimistic < any , void > ( { ancestorFetching : ancestor , ignoreCache : ignore } , ( ) => ( { ancestorFetching : false , ignoreCache : true } ) ) ;
28
+ const refetcherState = { ancestorFetching : rscContext . fetching , ignoreCache : ! ! navigationEvent [ 'ignoreCache' ] } ;
29
+ const [ { ancestorFetching, ignoreCache} , refetcher ] = useOptimistic < any , void > ( refetcherState , ( ) => ( { ancestorFetching : false , ignoreCache : true } ) ) ;
30
30
const cachedHistory = ! ignoreCache && history && ! ! historyCache [ url ] ?. [ sceneViewKey ] ;
31
31
if ( ! rscCache . get ( navigationEvent ) ) rscCache . set ( navigationEvent , { } ) ;
32
32
const cachedSceneViews = rscCache . get ( navigationEvent ) ;
0 commit comments