1
0

dangerous_inner_html.rs 402 B

12345678910111213141516171819
  1. #![allow(non_snake_case)]
  2. use dioxus::prelude::*;
  3. fn main() {
  4. dioxus::desktop::launch(App);
  5. }
  6. fn App(cx: Scope) -> Element {
  7. // ANCHOR: dangerous_inner_html
  8. // this should come from a trusted source
  9. let contents = "live <b>dangerously</b>";
  10. cx.render(rsx! {
  11. div {
  12. dangerous_inner_html: "{contents}",
  13. }
  14. })
  15. // ANCHOR_END: dangerous_inner_html
  16. }