@@ -17,7 +17,6 @@ import type {
1717 DataStrategyFunctionArgs ,
1818 DeferredData ,
1919 DeferredResult ,
20- DetectErrorBoundaryFunction ,
2120 ErrorResult ,
2221 FormEncType ,
2322 FormMethod ,
@@ -375,10 +374,6 @@ export interface RouterInit {
375374 routes : AgnosticRouteObject [ ] ;
376375 history : History ;
377376 basename ?: string ;
378- /**
379- * @deprecated Use `mapRouteProperties` instead
380- */
381- detectErrorBoundary ?: DetectErrorBoundaryFunction ;
382377 mapRouteProperties ?: MapRoutePropertiesFunction ;
383378 future ?: Partial < FutureConfig > ;
384379 hydrationData ?: HydrationState ;
@@ -810,18 +805,7 @@ export function createRouter(init: RouterInit): Router {
810805 "You must provide a non-empty routes array to createRouter"
811806 ) ;
812807
813- let mapRouteProperties : MapRoutePropertiesFunction ;
814- if ( init . mapRouteProperties ) {
815- mapRouteProperties = init . mapRouteProperties ;
816- } else if ( init . detectErrorBoundary ) {
817- // If they are still using the deprecated version, wrap it with the new API
818- let detectErrorBoundary = init . detectErrorBoundary ;
819- mapRouteProperties = ( route ) => ( {
820- hasErrorBoundary : detectErrorBoundary ( route ) ,
821- } ) ;
822- } else {
823- mapRouteProperties = defaultMapRouteProperties ;
824- }
808+ let mapRouteProperties = init . mapRouteProperties || defaultMapRouteProperties ;
825809
826810 // Routes keyed by ID
827811 let manifest : RouteManifest = { } ;
@@ -3399,10 +3383,6 @@ export const UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
33993383
34003384export interface CreateStaticHandlerOptions {
34013385 basename ?: string ;
3402- /**
3403- * @deprecated Use `mapRouteProperties` instead
3404- */
3405- detectErrorBoundary ?: DetectErrorBoundaryFunction ;
34063386 mapRouteProperties ?: MapRoutePropertiesFunction ;
34073387 future ?: { } ;
34083388}
@@ -3418,22 +3398,8 @@ export function createStaticHandler(
34183398
34193399 let manifest : RouteManifest = { } ;
34203400 let basename = ( opts ? opts . basename : null ) || "/" ;
3421- let mapRouteProperties : MapRoutePropertiesFunction ;
3422- if ( opts ?. mapRouteProperties ) {
3423- mapRouteProperties = opts . mapRouteProperties ;
3424- } else if ( opts ?. detectErrorBoundary ) {
3425- // If they are still using the deprecated version, wrap it with the new API
3426- let detectErrorBoundary = opts . detectErrorBoundary ;
3427- mapRouteProperties = ( route ) => ( {
3428- hasErrorBoundary : detectErrorBoundary ( route ) ,
3429- } ) ;
3430- } else {
3431- mapRouteProperties = defaultMapRouteProperties ;
3432- }
3433- // Config driven behavior flags
3434- let future = {
3435- ...opts ?. future ,
3436- } ;
3401+ let mapRouteProperties =
3402+ opts ?. mapRouteProperties || defaultMapRouteProperties ;
34373403
34383404 let dataRoutes = convertRoutesToDataRoutes (
34393405 routes ,
@@ -4677,10 +4643,9 @@ async function loadLazyRouteModule(
46774643 // updates and remove the `lazy` function so we don't resolve the lazy
46784644 // route again.
46794645 Object . assign ( routeToUpdate , {
4680- // To keep things framework agnostic, we use the provided
4681- // `mapRouteProperties` (or wrapped `detectErrorBoundary`) function to
4682- // set the framework-aware properties (`element`/`hasErrorBoundary`) since
4683- // the logic will differ between frameworks.
4646+ // To keep things framework agnostic, we use the provided `mapRouteProperties`
4647+ // function to set the framework-aware properties (`element`/`hasErrorBoundary`)
4648+ // since the logic will differ between frameworks.
46844649 ...mapRouteProperties ( routeToUpdate ) ,
46854650 lazy : undefined ,
46864651 } ) ;
0 commit comments