This commit is contained in:
parent
9ce8e13a41
commit
c10606e80e
|
@ -2,18 +2,19 @@ use yew::prelude::*;
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
fn App() -> Html {
|
fn App() -> Html {
|
||||||
let counter = use_state(|| 0);
|
let counter = use_state(|| 283870);
|
||||||
let onclick = {
|
let onclick = {
|
||||||
let counter = counter.clone();
|
let counter = counter.clone();
|
||||||
move |_| {
|
move |_| {
|
||||||
let value = *counter + 1;
|
let value = (*counter * 989_909) % 1_212_149;
|
||||||
counter.set(value);
|
counter.set(value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
html! {
|
html! {
|
||||||
<div>
|
<div>
|
||||||
<button {onclick}>{ "+1" }</button>
|
<h3>{ "Pseudo Random Generator" }</h3>
|
||||||
|
<button {onclick}>{ "next" }</button>
|
||||||
<p>{ *counter }</p>
|
<p>{ *counter }</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue