Recomponentify

This commit is contained in:
Greg Johnston 2022-08-11 07:15:00 -04:00
parent eb4d5abff9
commit af5becb85b
2 changed files with 3 additions and 2 deletions

View file

@ -8,6 +8,7 @@ struct CounterUpdater {
set_counters: WriteSignal<CounterHolder>,
}
#[component]
pub fn Counters(cx: Scope) -> web_sys::Element {
let (next_counter_id, set_next_counter_id) = cx.create_signal(0);
let (counters, set_counters) = cx.create_signal::<CounterHolder>(vec![]);

View file

@ -1,4 +1,4 @@
use counters::Counters;
use counters::{Counters, CountersProps};
use leptos::*;
#[global_allocator]
@ -7,5 +7,5 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
fn main() {
console_log::init_with_level(log::Level::Debug);
mount_to_body(|cx| Counters(cx))
mount_to_body(|cx| view! { <Counters/> })
}