polish the throw trait
This commit is contained in:
1 parent
c18f911429
commit
6141aeb037
8 files changed
+374
-119
No files matched your search
@@ -16,7 +16,7 @@ use crate::{
|
||||
use futures_util::{pin_mut, StreamExt};
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use slab::Slab;
|
||||
use std::{any::Any, cell::Cell, collections::BTreeSet, future::Future, rc::Rc};
|
||||
use std::{any::Any, cell::Cell, collections::BTreeSet, future::Future, rc::Rc, sync::Arc};
|
||||
|
||||
/// A virtual node system that progresses user events and diffs UI trees.
|
||||
///
|
||||
@@ -273,7 +273,10 @@ impl VirtualDom {
|
||||
);
|
||||
|
||||
// Unlike react, we provide a default error boundary that just renders the error as a string
|
||||
root.provide_context(Rc::new(ErrorBoundary::new(ScopeId::ROOT)));
|
||||
root.provide_context(Rc::new(ErrorBoundary::new_in_scope(
|
||||
ScopeId::ROOT,
|
||||
Arc::new(|_| {}),
|
||||
)));
|
||||
|
||||
// the root element is always given element ID 0 since it's the container for the entire tree
|
||||
dom.elements.insert(ElementRef::none());
|
||||
|
||||
Reference in new issue
Block a user