during SSR, don't dispose of preload owners until whole request is done

This commit is contained in:
Greg Johnston
2025-09-15 18:54:11 -04:00
parent ee731d7a3a
commit d1899cde1c

View File

@@ -429,6 +429,13 @@ where
&outer_owner,
);
let preload_owners = outlets
.iter()
.map(|o| o.preload_owner.clone())
.collect::<Vec<_>>();
outer_owner
.with(|| Owner::on_cleanup(move || drop(preload_owners)));
// outlets will not send their views if the loaders are never polled
// the loaders are async so that they can lazy-load routes in the browser,
// but they should always be synchronously available on the server