DioxusLabs / DioxusLabs/dioxus
With SSG, if root index has more than one element in the rsx, the second element shows on other pages
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
I see content from a different route with SSG. Per discussion https://discord.com/channels/899851952891002890/1276184595192348764/1332184863368806410
Slightly modifying the sample code for SSG from https://github.com/DioxusLabs/docsite/pull/394/files#diff-f0dc0decbe64520d7aece27061742d5a65655e474131969c8fcf2864556c9110 to just change one element like so:
```
fn Index() -> Element {
rsx! {
h1 { "Index" }
h2 { "This content is still visible" }
h2 { "So is this?" }
}
}
```
It is very worth noting in my mind that in my production app I see a full flash of the root index contents before other routes render, and then end up with the second element still visible. I can workaround the extra content by simply wrapping the elements in a div, but I thought we weren't supposed to need to do that with rsx... And I definitely still don't want to see the homepage flash on every page load if we can avoid it! (but that might be a separate bug, idk.)
**Steps To Reproduce**
- dx serve --platform web --ssg
- http://localhost:8080/other/
Index page shows all 3 elements as it should, but Other shows "Other" (as it should) and also "This content is still visible" (as it should not) -- but not "So is this?"
**Expected behavior**
Don't show content from other routes!
**Screenshots**

**Environment:**
`dioxus = { version = "0.6.2", features = ["router", "fullstack"] }`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.