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:
1 parent
ddc94cf44c
commit
b252528722
4 files changed
+53
-5
No files matched your search
@@ -36,6 +36,9 @@ enum Route {
|
||||
|
||||
#[component]
|
||||
fn Blog(id: i32) -> Element {
|
||||
let route: Route = use_route();
|
||||
assert_eq!(route, Route::Blog { id });
|
||||
|
||||
rsx! {
|
||||
Link { to: Route::Home {}, "Go home" }
|
||||
"id: {id}"
|
||||
@@ -51,8 +54,12 @@ fn ThrowsError() -> Element {
|
||||
|
||||
#[component]
|
||||
fn Home() -> Element {
|
||||
let route: Route = use_route();
|
||||
assert_eq!(route, Route::Home);
|
||||
|
||||
rsx! {
|
||||
"Home"
|
||||
Link { to: Route::Blog { id: 1 }, "Go to blog 1" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user