소스 검색

fix outlet depth override

Adrian Wannenmacher 2 년 전
부모
커밋
96bd8b5565
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      packages/router/src/components/outlet.rs

+ 1 - 2
packages/router/src/components/outlet.rs

@@ -90,8 +90,7 @@ pub fn Outlet(cx: Scope<OutletProps>) -> Element {
     let depth = cx.use_hook(|| {
         let mut context = cx.consume_context::<OutletData>().unwrap_or_default();
         let depth = depth
-            .or_else(|| context.depth(name))
-            .map(|d| d + 1)
+            .or_else(|| context.depth(name).map(|d| d + 1))
             .unwrap_or_default();
         context.set_depth(name, depth);
         cx.provide_context(context);