fix: ensure correct ownership chain when passing views through Outlet

This commit is contained in:
Greg Johnston 2024-06-30 21:52:40 -04:00
parent 059c8abd2f
commit 8f46288973
2 changed files with 11 additions and 2 deletions

View file

@ -59,6 +59,12 @@ where
observer,
sources: SourceSet::new(),
}));
crate::log_warning(format_args!(
"RenderEffect::<{}> owner is {:?} {:?}",
std::any::type_name::<T>(),
owner.debug_id(),
owner.ancestry()
));
let initial_value = cfg!(feature = "effects").then(|| {
owner.with(|| {

View file

@ -33,6 +33,7 @@ use std::{
};
use tachys::{
hydration::Cursor,
reactive_graph::OwnedView,
renderer::Renderer,
ssr::StreamBuilder,
view::{
@ -584,8 +585,10 @@ where
provide_context(matched);
let view =
owner.with(|| ScopedFuture::new(view.choose())).await;
tx.send(Box::new(move || owner.with(|| view.into_any())))
.unwrap();
tx.send(Box::new(move || {
owner.with(|| OwnedView::new(view).into_any())
}))
.unwrap();
trigger
}
})