From b05331a60bb8c019c5fdadaec0196699b4ad13f6 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 3 Jun 2021 10:43:48 -0400 Subject: [PATCH] Docs: change example to make it simpler --- README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 01ad8374d..0ba8116bb 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,8 @@ Dioxus is a portable, performant, and ergonomic framework for building cross-platform user experiences in Rust. ```rust -//! A complete dioxus web app -use dioxus_web::*; - -struct Props { initial_text: &'static str } - -fn Example(ctx: Context) -> VNode { - let selection = use_state(ctx, move || ctx.initial_text); +fn Example(ctx: Context<()>) -> VNode { + let selection = use_state(ctx, move || "..?"); ctx.render(rsx! { div { @@ -24,10 +19,6 @@ fn Example(ctx: Context) -> 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.