diff --git a/leptos/src/error_boundary.rs b/leptos/src/error_boundary.rs index b504fdeba..9bbaba22f 100644 --- a/leptos/src/error_boundary.rs +++ b/leptos/src/error_boundary.rs @@ -1,5 +1,5 @@ use crate::Children; -use leptos_dom::{Errors, IntoView}; +use leptos_dom::{Errors, HydrationCtx, IntoView}; use leptos_macro::{component, view}; use leptos_reactive::{ create_rw_signal, provide_context, signal_prelude::*, RwSignal, Scope, @@ -28,7 +28,7 @@ use leptos_reactive::{ /// } /// # }); /// ``` -#[component(transparent)] +#[component] pub fn ErrorBoundary( cx: Scope, /// The components inside the tag which will get rendered @@ -40,6 +40,7 @@ where F: Fn(Scope, RwSignal) -> IV + 'static, IV: IntoView, { + _ = HydrationCtx::next_component(); let errors: RwSignal = create_rw_signal(cx, Errors::default()); provide_context(cx, errors); diff --git a/leptos_dom/src/components/errors.rs b/leptos_dom/src/components/errors.rs index a7a068a87..6717e84c1 100644 --- a/leptos_dom/src/components/errors.rs +++ b/leptos_dom/src/components/errors.rs @@ -80,7 +80,7 @@ where E: Error + Send + Sync + 'static, { fn into_view(self, cx: leptos_reactive::Scope) -> crate::View { - let id = ErrorKey(HydrationCtx::peek().id.to_string().into()); + let id = ErrorKey(HydrationCtx::peek().fragment.to_string().into()); let errors = use_context::>(cx); match self { Ok(stuff) => {