mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-14 00:27:12 +00:00
use csr
feature so that reactivity runs
This commit is contained in:
parent
c02d89ff74
commit
14cde1bc1e
2 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,7 @@ codegen-units = 1
|
|||
lto = true
|
||||
|
||||
[dependencies]
|
||||
leptos = { path = "../../leptos" }
|
||||
leptos = { path = "../../leptos", features = ["csr"] }
|
||||
console_error_panic_hook = "0.1.7"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -8,6 +8,9 @@ use leptos::{
|
|||
// A component is really just a function call: it runs once to create the DOM and reactive system
|
||||
pub fn counter(initial_value: i32, step: u32) -> impl IntoView {
|
||||
let count = RwSignal::new(Count::new(initial_value, step));
|
||||
Effect::new(move |_| {
|
||||
leptos::logging::log!("count = {:?}", count.get());
|
||||
});
|
||||
|
||||
// the function name is the same as the HTML tag name
|
||||
div()
|
||||
|
@ -48,6 +51,7 @@ impl Count {
|
|||
}
|
||||
|
||||
pub fn value(&self) -> i32 {
|
||||
leptos::logging::log!("value = {}", self.value);
|
||||
self.value
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue