@@ -2174,10 +2174,8 @@ export class RouterCore<
21742174 return true
21752175 }
21762176
2177- if ( this . isServer ) {
2178- if ( match . ssr === false ) {
2179- return true
2180- }
2177+ if ( this . isServer && match . _nonReactive . ssr === false ) {
2178+ return true
21812179 }
21822180 return false
21832181 }
@@ -2248,15 +2246,13 @@ export class RouterCore<
22482246 ssr = matchId === rootRouteId
22492247 } else {
22502248 const defaultSsr = this . options . defaultSsr ?? true
2251- if ( parentMatch ?. ssr === false ) {
2249+ if ( parentMatch ?. _nonReactive . ssr === false ) {
22522250 ssr = false
22532251 } else {
22542252 let tempSsr : boolean | 'data-only'
22552253 if ( route . options . ssr === undefined ) {
22562254 tempSsr = defaultSsr
22572255 } else if ( typeof route . options . ssr === 'function' ) {
2258- const { search, params } = this . getMatch ( matchId ) !
2259-
22602256 function makeMaybe ( value : any , error : any ) {
22612257 if ( error ) {
22622258 return { status : 'error' as const , error }
@@ -2265,8 +2261,14 @@ export class RouterCore<
22652261 }
22662262
22672263 const ssrFnContext : SsrContextOptions < any , any , any > = {
2268- search : makeMaybe ( search , existingMatch . searchError ) ,
2269- params : makeMaybe ( params , existingMatch . paramsError ) ,
2264+ search : makeMaybe (
2265+ existingMatch . search ,
2266+ existingMatch . searchError ,
2267+ ) ,
2268+ params : makeMaybe (
2269+ existingMatch . params ,
2270+ existingMatch . paramsError ,
2271+ ) ,
22702272 location,
22712273 matches : matches . map ( ( match ) => ( {
22722274 index : match . index ,
@@ -2277,7 +2279,7 @@ export class RouterCore<
22772279 routeId : match . routeId ,
22782280 search : makeMaybe ( match . search , match . searchError ) ,
22792281 params : makeMaybe ( match . params , match . paramsError ) ,
2280- ssr : match . ssr ,
2282+ ssr : match . _nonReactive . ssr ,
22812283 } ) ) ,
22822284 }
22832285 tempSsr =
@@ -2286,17 +2288,17 @@ export class RouterCore<
22862288 tempSsr = route . options . ssr
22872289 }
22882290
2289- if ( tempSsr === true && parentMatch ?. ssr === 'data-only' ) {
2291+ if (
2292+ tempSsr === true &&
2293+ parentMatch ?. _nonReactive . ssr === 'data-only'
2294+ ) {
22902295 ssr = 'data-only'
22912296 } else {
22922297 ssr = tempSsr
22932298 }
22942299 }
22952300 }
2296- updateMatch ( matchId , ( prev ) => ( {
2297- ...prev ,
2298- ssr,
2299- } ) )
2301+ existingMatch . _nonReactive . ssr = ssr
23002302 }
23012303
23022304 if ( shouldSkipLoader ( matchId ) ) {
@@ -2609,7 +2611,7 @@ export class RouterCore<
26092611 if (
26102612 ! this . isServer ||
26112613 ( this . isServer &&
2612- this . getMatch ( matchId ) ! . ssr === true )
2614+ this . getMatch ( matchId ) ! . _nonReactive . ssr === true )
26132615 ) {
26142616 this . loadRouteChunk ( route )
26152617 }
0 commit comments