I have a json file in my assets that contains a basic json like
{
"name": "hello"
}
I have a method to load this file with serde_json
and I would like to display the content of this file in a [component]
.
Ideally I don't want to reload this file at every re-render.
I have something like this in mind :
#[component]
pub fn Display() -> impl IntoView {
let data = StoredValue::new(load_json());
view! {
<p>
{ data.name }
</p>
}
}
But I can't make it work.