feat: more API updates

This commit is contained in:
Jonathan Kelley committed 2021-12-28 23:20:01 -05:00
1 parent b3ac2ee3f7
commit a4f280d163
17 files changed
+227 -189

No files matched your search

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