DioxusLabs / DioxusLabs/dioxus

Interpolation in multiple class tags only works after hotreload

Open
#4,070 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

Multiple `class` tag concatenation doesn't seem to work at load, if one of the `class` tags contains an interpolated variable.

**Steps To Reproduce**

The following works as expected
```rs
#[component]
fn Thing(more_class: &'static str) -> Element {
rsx! {
div { class: "flex {more_class}",
"text"
}
}
}
```

The following has generated `class` empty on load after full rebuild or just launching the executable
```rs
#[component]
fn Thing(more_class: &'static str) -> Element {
rsx! {
div { class: "flex", // a lot of other classes on the same line
class: "{more_class}", // hence the multiple class tags which usually get concatenated
"text"
}
}
}
```
generates : `

` until next hotreload, where it properly gets all the concatenated+interpolated class list

**Environment:**

- Dioxus version: dioxus 0.6.3
- Rust version: 1.86.0
- OS info: Windows10 22H2
- App platform: desktop

Thanks forward

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.