DioxusLabs / DioxusLabs/dioxus
UI no longer renders even after reverting recently added code
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
Environment:
- OS: Linux (kernel 6.16.8, x86_64)
- Dioxus version: [0.7.0]
- Rust version: [rustc 1.91.0 (f8297e351 2025-10-28)]
- Originally, I was able to use this code to disable Dioxus's built-in menu bar and display content.:
```toml
[package]
name = "test1"
version = "0.1.0"
edition = "2024"
[dependencies]
dioxus = { version = "0.7.0", features = ["desktop"]}
dioxus-desktop = { version = "0.7.0-rc.3" }
dioxus-primitives = { git = "https://github.com/DioxusLabs/components", version = "0.0.1", default-features = false }
[profile]
[profile.wasm-dev]
inherits = "dev"
opt-level = 1
[profile.server-dev]
inherits = "dev"
[profile.android-dev]
inherits = "dev"
```
```rust
use dioxus::prelude::*;
use dioxus_desktop::{window, Config, WindowBuilder};
fn main() {
dioxus::LaunchBuilder::desktop()
.with_cfg(
Config::new().with_window(
WindowBuilder::new()
.with_title("Hello Dioxus")
.with_decorations(false)
.with_always_on_top(true)
)
)
.launch(App);
}
#[component]
fn App() -> Element {
use_effect(|| {
window().set_decorations(true);
});
rsx!{
"Hello Dioxus"
}
}
```
- After I added the Components Menubar, the app stopped behaving correctly: the Dioxus built-in menu bar and title bar no longer appear, and no content is displayed.:
```rust
use dioxus::prelude::*;
use dioxus_desktop::{window, Config, WindowBuilder};
use dioxus_primitives::menubar::*;
fn main() {
dioxus::LaunchBuilder::desktop()
.with_cfg(
Config::new().with_window(
WindowBuilder::new()
.with_title("Hello Dioxus")
.with_decorations(false)
.with_always_on_top(true)
)
)
.launch(App);
}
#[component]
fn App() -> Element {
use_effect(|| {
window().set_decorations(true);
});
rsx!{
div {
Menubar {
MenubarMenu {
index: 0usize,
MenubarTrigger {
"File"
}
MenubarContent {
MenubarItem {
index: 0usize,
value: "new".to_string(),
on_select: move |v| {
println!("点击了:{}", v)
},
"New"
}
MenubarItem {
index: 1usize,
value: "open".to_string(),
on_select: move |v| {
println!("点击了:{}", v)
},
"Open"
}
}
}
}
}
"Hello Dioxus"
}
}
```
- Finally, even after reverting to the most basic setup, the content still does not display. Running cargo clean and recompiling did not resolve the issue.
```rust
use dioxus::prelude::*;
// use dioxus_desktop::{window, Config, WindowBuilder};
// use dioxus_primitives::menubar::*;
fn main() {
// dioxus::LaunchBuilder::desktop()
// .with_cfg(
// Config::new().with_window(
// WindowBuilder::new()
// .with_title("Hello Dioxus")
// .with_decorations(false)
// .with_always_on_top(true)
//
// )
// )
// .launch(App);
// dioxus::launch(App);
dioxus::LaunchBuilder::desktop().launch(App);
}
#[component]
fn App() -> Element {
// use_effect(|| {
// window().set_decorations(true);
// });
rsx!{
// div {
// Menubar {
// MenubarMenu {
// index: 0usize,
// MenubarTrigger {
// "File"
// }
// MenubarContent {
// MenubarItem {
// index: 0usize,
// value: "new".to_string(),
// on_select: move |v| {
// println!("点击了:{}", v)
// },
// "New"
// }
// MenubarItem {
// index: 1usize,
// value: "open".to_string(),
// on_select: move |v| {
// println!("点击了:{}", v)
// },
// "Open"
// }
// }
// }
// }
// }
//
"Hello Dioxus"
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.