overhaul dioxus fullstack using a new implementation of server_fn This PR is a complete rewrite of dioxus fullstack designed to improve compatibility with axum and to fix a number of compilation errors based on feature flag unification plumbing through macros.
26 lines
540 B
Rust
26 lines
540 B
Rust
//! XSS Safety
|
|
//!
|
|
//! This example proves that Dioxus is safe from XSS attacks.
|
|
|
|
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
dioxus::launch(app);
|
|
}
|
|
|
|
fn app() -> Element {
|
|
let mut contents = use_signal(|| String::from("<script>alert(\"hello world\")</script>"));
|
|
|
|
rsx! {
|
|
div {
|
|
h1 {"Dioxus is XSS-Safe"}
|
|
h3 { "{contents}" }
|
|
input {
|
|
value: "{contents}",
|
|
r#type: "text",
|
|
oninput: move |e| contents.set(e.value()),
|
|
}
|
|
}
|
|
}
|
|
}
|