// TODO-APP: handle case where history.state is not the new router history entry
// url,
constserverResponse=awaitfetchServerResponse(
// // initialTree is used when history.state.tree is missing because the history state is set in `useEffect` below, it being missing means this is the hydration case.
url,
// window.history.state?.tree || initialTree,
// initialTree is used when history.state.tree is missing because the history state is set in `useEffect` below, it being missing means this is the hydration case.
// true
window.history.state?.tree||initialTree,
// )
true
// // @ts-ignore startTransition exists
)
// React.startTransition(() => {
// @ts-ignore startTransition exists
// dispatch({
React.startTransition(()=>{
// type: ACTION_PREFETCH,
dispatch({
// url,
type:ACTION_PREFETCH,
// serverResponse,
url,
// })
serverResponse,
// })
})
// } catch (err) {
})
// console.error('PREFETCH ERROR', err)
}catch(err){
// }
console.error('PREFETCH ERROR',err)
}
},
},
replace:(href,options={})=>{
replace:(href,options={})=>{
// @ts-ignore startTransition exists
// @ts-ignore startTransition exists
...
@@ -268,7 +266,7 @@ export default function AppRouter({
...
@@ -268,7 +266,7 @@ export default function AppRouter({
}
}
returnrouterInstance
returnrouterInstance
},[dispatch,initialTree])
},[dispatch/*, initialTree*/])
useEffect(()=>{
useEffect(()=>{
// When mpaNavigation flag is set do a hard navigation to the new url.
// When mpaNavigation flag is set do a hard navigation to the new url.