use yew::prelude::*;
#[function_component(CheckMnemonic)]
pub fn check_mnemonic() -> Html {
let phrase_state =
use_state(|| vec!["India".to_owned(), "Norway".to_owned(), "Bhutan".to_owned()]);
html! {
<>
{for phrase_state.iter().map(|cont|
html!{
<>
<input type="text" class="form-control" readonly=true value={&cont[..]}/>
</>
}
)}
</>
}
}
Gives error
error[E0597]: `phrase_state` does not live long enough
--> src/components/accounts/multistep_account_creation/check_mnemonic.rs:63:14
|
63 | {for phrase_state.iter().map(|cont| {
| ^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
...
67 | <input type="text" class="form-control" readonly=true value={&cont[..]} onclick={add_tag.clone()}/>
| - argument requires that `phrase_state` is borrowed for `'static`
...
73 | }
| - `phrase_state` dropped here while still borrowed