From d51b6268eb0c20bbab6512b7e365dd5625cafe5a Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 11 Jan 2024 17:20:53 -0600 Subject: [PATCH] restore error boundaries in core --- packages/core/src/error_boundary.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/error_boundary.rs b/packages/core/src/error_boundary.rs index 195b6f38d..095c91aa5 100644 --- a/packages/core/src/error_boundary.rs +++ b/packages/core/src/error_boundary.rs @@ -1,6 +1,8 @@ use crate::{ global_context::{consume_context, current_scope_id}, - Element, IntoDynNode, Properties, ScopeId, Template, TemplateAttribute, TemplateNode, VNode, + innerlude::provide_context, + once, Element, IntoDynNode, Properties, ScopeId, Template, TemplateAttribute, TemplateNode, + VNode, }; use std::{ any::{Any, TypeId}, @@ -13,8 +15,7 @@ use std::{ /// Provide an error boundary to catch errors from child components pub fn use_error_boundary() -> ErrorBoundary { - // use_hook(|| cx.provide_context(ErrorBoundary::new())) - todo!() + once(|| provide_context(ErrorBoundary::new())) } /// A boundary that will capture any errors from child components