Docs: change example to make it simpler

This commit is contained in:
Jonathan Kelley committed 2021-06-03 10:43:48 -04:00
1 parent 50c8b93aad
commit b05331a60b
1 file changed
+2 -11
+2 -11
View File
@@ -8,13 +8,8 @@
Dioxus is a portable, performant, and ergonomic framework for building cross-platform user experiences in Rust. Dioxus is a portable, performant, and ergonomic framework for building cross-platform user experiences in Rust.
```rust ```rust
//! A complete dioxus web app fn Example(ctx: Context<()>) -> VNode {
use dioxus_web::*; let selection = use_state(ctx, move || "..?");
struct Props { initial_text: &'static str }
fn Example(ctx: Context<Props>) -> VNode {
let selection = use_state(ctx, move || ctx.initial_text);
ctx.render(rsx! { ctx.render(rsx! {
div { div {
@@ -24,10 +19,6 @@ fn Example(ctx: Context<Props>) -> VNode {
} }
}) })
}; };
fn main() {
dioxus_web::start_with_props(Example, Props { initial_text: "..?" }).block_on();
}
``` ```
Dioxus can be used to deliver webapps, desktop apps, static pages, liveview apps, Android apps, iOS Apps, and more. At its core, Dioxus is entirely renderer agnostic and has great documentation for creating new renderers for any platform. Dioxus can be used to deliver webapps, desktop apps, static pages, liveview apps, Android apps, iOS Apps, and more. At its core, Dioxus is entirely renderer agnostic and has great documentation for creating new renderers for any platform.