feat: transition to cx, props

This commit is contained in:
Jonathan Kelley committed 2021-09-21 13:13:15 -04:00
1 parent f1cff845ce
commit bfdcb20437
14 files changed
+88 -50

No files matched your search

+2 -2
View File
@@ -15,12 +15,12 @@ fn new_dom() -> TestDom {
fn shared_state_test() {
struct MySharedState(&'static str);
static App: FC<()> = |cx| {
static App: FC<()> = |cx, props| {
cx.use_provide_state(|| MySharedState("world!"));
rsx!(cx, Child {})
};
static Child: FC<()> = |cx| {
static Child: FC<()> = |cx, props| {
let shared = cx.use_consume_state::<MySharedState>()?;
rsx!(cx, "Hello, {shared.0}")
};