Swapping an element's class such that a different ::before content rule applies — the icon-font pattern, e.g. FontAwesome <i class="fa-solid fa-play"> → fa-pause — does not update the rendered glyph. Sibling text driven by the same state updates fine, so this is specific to pseudo-element content re-resolution on class change.
Workaround: swap the element instead of the class (if/else rsx branches produce distinct nodes). The idiomatic dynamic-class form is what every Dioxus + icon-font app writes first.
Swapping an element's class such that a different
::beforecontent rule applies — the icon-font pattern, e.g. FontAwesome<i class="fa-solid fa-play">→fa-pause— does not update the rendered glyph. Sibling text driven by the same state updates fine, so this is specific to pseudo-element content re-resolution on class change.Workaround: swap the element instead of the class (if/else rsx branches produce distinct nodes). The idiomatic dynamic-class form is what every Dioxus + icon-font app writes first.