@@ -120,7 +120,9 @@ function ExpandableSidebarItem({
120120 hideArrow = { isForceExpanded }
121121 onToggle = { onToggle }
122122 />
123- < CollapseWrapper duration = { 250 } isExpanded = { isForceExpanded || isExpanded } >
123+ < CollapseWrapper
124+ duration = { 250 }
125+ isExpanded = { isForceExpanded || isExpanded } >
124126 < SidebarRouteTree
125127 isForceExpanded = { isForceExpanded }
126128 routeTree = { { title, routes} }
@@ -142,13 +144,14 @@ export function SidebarRouteTree({
142144 const pendingRoute = usePendingRoute ( ) ;
143145 const currentRoutes = routeTree . routes as RouteItem [ ] ;
144146
145- const defaultExpandedPath = currentRoutes . find ( ( { path} ) => {
146- const isBreadcrumb =
147- breadcrumbs . length > 1 &&
148- breadcrumbs [ breadcrumbs . length - 1 ] . path === path ;
149- const selected = slug === path ;
150- return isBreadcrumb || selected ;
151- } ) ?. path || null ;
147+ const defaultExpandedPath =
148+ currentRoutes . find ( ( { path} ) => {
149+ const isBreadcrumb =
150+ breadcrumbs . length > 1 &&
151+ breadcrumbs [ breadcrumbs . length - 1 ] . path === path ;
152+ const selected = slug === path ;
153+ return isBreadcrumb || selected ;
154+ } ) ?. path || null ;
152155
153156 const [ expandedPath , setExpandedPath ] = useState < string | null > (
154157 defaultExpandedPath
@@ -203,7 +206,7 @@ export function SidebarRouteTree({
203206 pendingRoute = { pendingRoute }
204207 isExpanded = { expandedPath === path }
205208 onToggle = { ( ) =>
206- setExpandedPath ( expandedPath === path ? null : ( path || null ) )
209+ setExpandedPath ( expandedPath === path ? null : path || null )
207210 }
208211 />
209212 ) ;
0 commit comments