Skip to content

Interpolation in multiple class tags only works after hotreload #4070

@oletf

Description

@oletf

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

#[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

#[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 : <div class> 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions