diff --git a/packages/router/src/components/outlet.rs b/packages/router/src/components/outlet.rs index 914a1eb04..c1fcd3b5f 100644 --- a/packages/router/src/components/outlet.rs +++ b/packages/router/src/components/outlet.rs @@ -90,8 +90,7 @@ pub fn Outlet(cx: Scope) -> Element { let depth = cx.use_hook(|| { let mut context = cx.consume_context::().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);