You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While on the ParentRoute page (in this example, on homepage), clicking on "A" link with child route won't load HTML content of route's corresponding function.
Leptos Dependencies
[dependencies]
leptos = { version = "0.7.0", features = ["nightly"] }
leptos_router = { version = "0.7.0", features = ["nightly"] }
axum = { version = "0.7", optional = true }
console_error_panic_hook = "0.1"leptos_axum = { version = "0.7.0", optional = true }
leptos_meta = { version = "0.7.0" }
tokio = { version = "1", features = ["rt-multi-thread"], optional = true }
tower = { version = "0.4", optional = true }
tower-http = { version = "0.5", features = ["fs"], optional = true }
wasm-bindgen = "=0.2.96"thiserror = "1"tracing = { version = "0.1", optional = true }
http = "1"
[features]
hydrate = ["leptos/hydrate"]
ssr = [
"dep:axum",
"dep:tokio",
"dep:tower",
"dep:tower-http",
"dep:leptos_axum",
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
"dep:tracing",
]
To Reproduce
Steps to reproduce the behavior:
Install base template: cargo leptos new --git https://github.com/leptos-rs/start-axum
Change <Route path=StaticSegment("") view=HomePage/> to
Add "A", "ParentRoute" and "nested_router::Outlet" to "use leptos_router"
use leptos_router::{
components::{A,Route,Router,Routes,ParentRoute},StaticSegment,
nested_router::Outlet};
Move <Title text="Welcome to Leptos"/> from App() function to HomePage() in app.rs file
Add to HomePage() function
<div><A href="test">"Go to Test page"</A></div>
<Outlet/>
Add Test() function to app.rs
#[component]fnTest() -> implIntoView{view!{
<Title text="Test page"/>
<h1>"New page title"</h1>
"Line that will prevail"
<div><A href="/">"Go to Home page"</A></div>
}}
Text "Line that will prevail" will be dublicated (showed twice)
Click on "Go to Home page" again:
Page title will NOT change from "Test page" to "Welcome to Leptos"
Text "Line that will prevail" will remain
Expected behavior
While on the homepage, by clicking on "Go to Test page" link with child route, load HTML content of route's corresponding Test() function.
I tried the same process on a different PC (Windows) and under a virtual machine (Linux). Results are the same;
On mobile phone, if I enter homepage URL manually, child page act like on PC (what I described above);
On mobile phone, if I load homepage from bookmark child page loads ok;
On mobile phone (Android), I tried Chrome, Brave, Firefox, Opera browsers;
On mobile phone I get website through Wi-Fi from PC localhost;
Line with text that remains after going back to the homepage is that in simple text form "like this". If add tags <p>"like this"</p> it won't remain and will disappear like it supposed;
I just cloned the starter template, copied and pasted in the complete example you give at the end, and it works correctly, so I'm sorry to say I can't reproduce the issue you're having.
I just cloned the starter template, copied and pasted in the complete example you give at the end, and it works correctly, so I'm sorry to say I can't reproduce the issue you're having.
Based on the behavior that I described, maybe you could think of some idea, what could I try to do?
Okay, reading through the additional context: I missed that this was in nightly. When I also tried with nightly, I get the same issue. (The issue does not occur on stable.)
Describe the bug
While on the ParentRoute page (in this example, on homepage), clicking on
"A"
link with child route won't load HTML content of route's corresponding function.Leptos Dependencies
To Reproduce
Steps to reproduce the behavior:
cargo leptos new --git https://github.com/leptos-rs/start-axum
<Route path=StaticSegment("") view=HomePage/>
to"A"
,"ParentRoute"
and"nested_router::Outlet"
to "use leptos_router"<Title text="Welcome to Leptos"/>
fromApp()
function toHomePage()
in app.rs fileHomePage()
functionTest()
function to app.rscargo leptos serve
Expected behavior
While on the homepage, by clicking on "Go to Test page" link with child route, load HTML content of route's corresponding
Test()
function.Screenshots
https://github.com/user-attachments/assets/e696f737-7e4a-428c-82d8-341e397d2bc9
Additional context
"like this"
. If add tags<p>"like this"</p>
it won't remain and will disappear like it supposed;app.rs file
The text was updated successfully, but these errors were encountered: