@@ -15,7 +15,6 @@ import type {
1515 DataResult ,
1616 DataStrategyFunction ,
1717 DataStrategyFunctionArgs ,
18- DetectErrorBoundaryFunction ,
1918 ErrorResult ,
2019 FormEncType ,
2120 FormMethod ,
@@ -365,10 +364,6 @@ export interface RouterInit {
365364 routes : AgnosticRouteObject [ ] ;
366365 history : History ;
367366 basename ?: string ;
368- /**
369- * @deprecated Use `mapRouteProperties` instead
370- */
371- detectErrorBoundary ?: DetectErrorBoundaryFunction ;
372367 mapRouteProperties ?: MapRoutePropertiesFunction ;
373368 future ?: Partial < FutureConfig > ;
374369 hydrationData ?: HydrationState ;
@@ -799,18 +794,7 @@ export function createRouter(init: RouterInit): Router {
799794 "You must provide a non-empty routes array to createRouter"
800795 ) ;
801796
802- let mapRouteProperties : MapRoutePropertiesFunction ;
803- if ( init . mapRouteProperties ) {
804- mapRouteProperties = init . mapRouteProperties ;
805- } else if ( init . detectErrorBoundary ) {
806- // If they are still using the deprecated version, wrap it with the new API
807- let detectErrorBoundary = init . detectErrorBoundary ;
808- mapRouteProperties = ( route ) => ( {
809- hasErrorBoundary : detectErrorBoundary ( route ) ,
810- } ) ;
811- } else {
812- mapRouteProperties = defaultMapRouteProperties ;
813- }
797+ let mapRouteProperties = init . mapRouteProperties || defaultMapRouteProperties ;
814798
815799 // Routes keyed by ID
816800 let manifest : RouteManifest = { } ;
@@ -3287,10 +3271,6 @@ export function createRouter(init: RouterInit): Router {
32873271
32883272export interface CreateStaticHandlerOptions {
32893273 basename ?: string ;
3290- /**
3291- * @deprecated Use `mapRouteProperties` instead
3292- */
3293- detectErrorBoundary ?: DetectErrorBoundaryFunction ;
32943274 mapRouteProperties ?: MapRoutePropertiesFunction ;
32953275 future ?: { } ;
32963276}
@@ -3306,22 +3286,8 @@ export function createStaticHandler(
33063286
33073287 let manifest : RouteManifest = { } ;
33083288 let basename = ( opts ? opts . basename : null ) || "/" ;
3309- let mapRouteProperties : MapRoutePropertiesFunction ;
3310- if ( opts ?. mapRouteProperties ) {
3311- mapRouteProperties = opts . mapRouteProperties ;
3312- } else if ( opts ?. detectErrorBoundary ) {
3313- // If they are still using the deprecated version, wrap it with the new API
3314- let detectErrorBoundary = opts . detectErrorBoundary ;
3315- mapRouteProperties = ( route ) => ( {
3316- hasErrorBoundary : detectErrorBoundary ( route ) ,
3317- } ) ;
3318- } else {
3319- mapRouteProperties = defaultMapRouteProperties ;
3320- }
3321- // Config driven behavior flags
3322- let future = {
3323- ...opts ?. future ,
3324- } ;
3289+ let mapRouteProperties =
3290+ opts ?. mapRouteProperties || defaultMapRouteProperties ;
33253291
33263292 let dataRoutes = convertRoutesToDataRoutes (
33273293 routes ,
@@ -4536,10 +4502,9 @@ async function loadLazyRouteModule(
45364502 // updates and remove the `lazy` function so we don't resolve the lazy
45374503 // route again.
45384504 Object . assign ( routeToUpdate , {
4539- // To keep things framework agnostic, we use the provided
4540- // `mapRouteProperties` (or wrapped `detectErrorBoundary`) function to
4541- // set the framework-aware properties (`element`/`hasErrorBoundary`) since
4542- // the logic will differ between frameworks.
4505+ // To keep things framework agnostic, we use the provided `mapRouteProperties`
4506+ // function to set the framework-aware properties (`element`/`hasErrorBoundary`)
4507+ // since the logic will differ between frameworks.
45434508 ...mapRouteProperties ( routeToUpdate ) ,
45444509 lazy : undefined ,
45454510 } ) ;
0 commit comments