1
0

dangerous_inner_html.rs 390 B

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