wip: clean up, use old approach to components

This commit is contained in:
Jonathan Kelley committed 2021-11-07 20:59:09 -05:00
1 parent 289d2f2518
commit 2559740463
18 files changed
+180 -247

No files matched your search

+2 -2
View File
@@ -13,12 +13,12 @@ mod test_logging;
fn shared_state_test() {
struct MySharedState(&'static str);
static App: FC<()> = |(cx, props)| {
static App: FC<()> = |cx, props| {
cx.provide_state(MySharedState("world!"));
cx.render(rsx!(Child {}))
};
static Child: FC<()> = |(cx, props)| {
static Child: FC<()> = |cx, props| {
let shared = cx.consume_state::<MySharedState>()?;
cx.render(rsx!("Hello, {shared.0}"))
};