Fix router state after client side navigation (#4383)

* Fix router state after client side navigation

* add client side navigation to the fullstack routing spec

* fix playwright test
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-07-07 13:43:32 -05:00
1 parent ddc94cf44c
commit b252528722
4 files changed
+53 -5

No files matched your search

+3 -5
View File
@@ -2,10 +2,8 @@
use std::cell::OnceCell;
use dioxus_core::{
prelude::{generation, queue_effect},
schedule_update,
};
use dioxus_core::{prelude::queue_effect, schedule_update};
use dioxus_fullstack_protocol::is_hydrating;
use dioxus_history::History;
// If we are currently in a scope and this is the first run then queue a rerender
@@ -14,7 +12,7 @@ fn match_hydration<O>(
during_hydration: impl FnOnce() -> O,
after_hydration: impl FnOnce() -> O,
) -> O {
if generation() == 0 {
if is_hydrating() {
let update = schedule_update();
queue_effect(move || update());
during_hydration()