- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
#[page]
pub async fn page(cx: &Cx) -> Result<impl View> {
// This state variable is initialized on the server, but lives in the browser.
let count = signal(cx, || 0i32);
Ok(view! {
<button @click=$(|_e| count.increment())>"increment"</button>
<button @click=$(|_e| count.decrement())>"decrement"</button>
// The count updates when clicking the buttons. No server roundtrip.
<div>$(count.get())</div>
})
}
Follow us!
Это такой реакт как я опнима, судя по
?