From 55a5541dba8c35f63bb49b7ec5c0f1a28dc40b55 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Mar 2021 14:09:18 -0500 Subject: [PATCH] WIP: some docs --- notes/SOLVEDPROBLEMS.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/notes/SOLVEDPROBLEMS.md b/notes/SOLVEDPROBLEMS.md index 5329ffb74..8c471eb81 100644 --- a/notes/SOLVEDPROBLEMS.md +++ b/notes/SOLVEDPROBLEMS.md @@ -360,3 +360,37 @@ The DomTree object purely represents a viewable "key". It also forces components ## Events Events are finally in! To do events properly, we are abstracting over the event source with synthetic events. This forces 3rd party renderers to create the appropriate cross-platform event + + +## Optional Props on Components + +A major goal here is ergonomics. Any field that is Option should default to none. + +```rust + +rsx! { + Example { /* args go here */ a: 10, b: 20 } +} + + +``` + +```rust +#[derive(Properties)] +struct Props { + +} + +static Component: FC = |ctx, props| { + +} +``` + +or + +```rust +#[fc] +static Component: FC = |ctx, name: &str| { + +} +```