Fix hydration error suspense (#4640)

* Fix hydration of error boundaries

* add a regression test

* add more comments

* fix typos

* more typos

* fix clippy
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-10-02 22:21:41 -07:00
1 parent ad40f81607
commit d65f9a53c4
15 files changed
+249 -36

No files matched your search

+7 -1
View File
@@ -135,8 +135,14 @@ pub async fn run(mut virtual_dom: VirtualDom, web_config: Config) -> ! {
virtual_dom.in_runtime(|| dioxus_core::ScopeId::APP.throw_error(error));
}
server_data.in_context(|| {
#[cfg(feature = "document")]
virtual_dom.in_runtime(|| {
// Provide a hydration compatible create error boundary method
dioxus_core::ScopeId::ROOT.in_runtime(|| {
dioxus_core::provide_create_error_boundary(
dioxus_fullstack_hooks::errors::init_error_boundary,
);
});
#[cfg(feature = "document")]
document::init_fullstack_document();
});
virtual_dom.rebuild(&mut websys_dom);